list of non-printing table

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: list of non-printing table
Date: 2003-03-11 19:07:59
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB04C74775@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howdy:

I'm running PostgreSQL 7.2.1 on RedHat Linux 7.2.

I am trying to get a list of tables that does not have a
description, but I am unsure about how to do this.

I have a query:

[snip]

select
-- distinct
a.relname as "name of table",
a.oid,
b.description as "table description",
c.usename as "owner"
from
pg_class a,
pg_description b,
pg_user c
where
a.oid = b.objoid
and a.relkind = 'r'
and a.relname ~ '[A-Za-z]'
--and a.relname like 'test200%'
and a.relname not like 'pg_%'
and a.relowner = c.usesysid
-- and b.description
order by
a.relname
;

[/snip]

where the results will be a list of tables that exist and
have descriptions. However, I can see from the list a
lot of tables that does exist but does not have a description
next to it. I want the latter.

I thought about trying to generate two lists, maybe by means
of a join, to match one list against the other (full list of tables
vs. list of tables with actual description). Althought that might
work, I was hoping there was some shorter way to
say:

[snip]

...
where b.description is null
or
where b.descripton = ''

[/snip]

As a note: the above portions does not seem to work
for me.

Suggestions?

Thanks!

-X

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-03-11 19:17:59 Re: commiting in/between functions
Previous Message Magnus Månsson 2003-03-11 18:52:53 Re: commiting in/between functions