Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table definition for programmers .... ?!?!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi ...

i am trying to get the table definition of a table for programming ... i know that its \d <tablename> in the psql-tool ... but that doesn't help much for working that into source code, does it ? :)
I also know that pg_attributes holds all data i need to know about the table but i have to give the oid of the table to identify it - where from do i get this oid just by giving the name of the table ?
 
ok ... for all who want to know :

additionally to * one can ask for oid :
select oid, * from ... returns more than select * from ...
with pg_class and pg_attributes the problem is solved ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top