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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Graeme Longman
Sent: 11 July 2001 13:07
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED]


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to