list of non-printing table - Mailing list pgsql-general

From Johnson, Shaunn
Subject list of non-printing table
Date
Msg-id 73309C2FDD95D11192E60008C7B1D5BB04C74775@snt452.corp.bcbsm.com
Whole thread Raw
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: commiting in/between functions
Next
From: Magnus Månsson
Date:
Subject: Re: commiting in/between functions