Thread: Need a SQL to find if table has OIDS

Need a SQL to find if table has OIDS

From
Francisco Leovey
Date:
Hello group
 
Using Postgres 9.0.3
 
I need a SQL statement that will tell me if a given table is defined  WITH (OIDS=TRUE)
I am able to get column names, data types, etc but this eludes me.
 
Thank you

Re: Need a SQL to find if table has OIDS

From
Andreas Kretschmer
Date:
Francisco Leovey <fleovey@yahoo.com> wrote:

> Hello group
>
> Using Postgres 9.0.3
>
> I need a SQL statement that will tell me if a given table is defined  WITH
> (OIDS=TRUE)
> I am able to get column names, data types, etc but this eludes me.

select relhasoids from pg_class where relname = 'your_table';


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°