Re: find column OID types with information schema? - Mailing list pgsql-general

From Tom Lane
Subject Re: find column OID types with information schema?
Date
Msg-id 5926.1240849781@sss.pgh.pa.us
Whole thread Raw
In response to Re: find column OID types with information schema?  (Whit Armstrong <armstrong.whit@gmail.com>)
Responses Re: find column OID types with information schema?
List pgsql-general
Whit Armstrong <armstrong.whit@gmail.com> writes:
> However, there is no example that uses a schema + tablename.

If you're into masochism you can do that with a join of pg_class and
pg_namespace.  But what's usually easier for one-off queries is to
use the regclass converter:

select attname, atttypid from pg_attribute
where attrelid = 'myschema.mytable'::regclass;

Most likely you'll also want

... and attnum > 0 and not attisdropped

to keep down the clutter.

            regards, tom lane

pgsql-general by date:

Previous
From: Kynn Jones
Date:
Subject: Re: Which header and lib files to use when compiling libpq-code?
Next
From: Tom Lane
Date:
Subject: Re: Which header and lib files to use when compiling libpq-code?