Search Postgresql Archives

Re: Getting table metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




SELECT * FROM pg_attribute WHERE attrelid=<the table oid>;


The problem I'm running into however, is that given a table name, there
doesn't seem to be any way to get the table oid. Is there some function
or query that does this?

I think a way to get the table oid is:


select oid from pg_class where relname=<table_name>

Ntinos Katsaros

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux