RE: How do system tables relate to other tables in postgresql - Mailing list pgsql-general

From tamsin
Subject RE: How do system tables relate to other tables in postgresql
Date
Msg-id NEBBKHBOBMJCHDMGKCNJIEODDAAA.tg_mail@bryncadfan.co.uk
Whole thread Raw
In response to How do system tables relate to other tables in postgresql  ("Graeme Longman" <graeme@saebex.com>)
List pgsql-general
think this should do it:

select attname from pg_attribute
where attnotnull = 't'
and attrelid =
(select oid from pg_class where relname = 'tablename');

regards,
tamsin


-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Graeme Longman
Sent: 11 July 2001 13:07
To: pgsql-general@postgresql.org
Subject: [GENERAL] How do system tables relate to other tables in
postgresql


Hi,

Hope you can help me out.

I'm trying to write a select statement which returns the all the columns of
a table with a 'not null' modifier.

I realise that I will need to use the system tables but can't work out which
columns of which system tables to include in my statement.

Thanks for any help in advance,
Graeme


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: Re: Partial Indices vs. mixing columns and functions
Next
From: Peter Eisentraut
Date:
Subject: Re: OIDs