RE: How do system tables relate to other tables in postgresql

From: "tamsin" <tg_mail(at)bryncadfan(dot)co(dot)uk>
To: <pgsql-general(at)postgresql(dot)org>
Subject: RE: How do system tables relate to other tables in postgresql
Date: 2001-07-11 14:51:24
Message-ID: NEBBKHBOBMJCHDMGKCNJIEODDAAA.tg_mail@bryncadfan.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Graeme Longman
Sent: 11 July 2001 13:07
To: pgsql-general(at)postgresql(dot)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(at)postgresql(dot)org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-07-11 15:00:17 Re: OIDs
Previous Message Mike Mascari 2001-07-11 14:31:19 Re: Partial Indices vs. mixing columns and functions