how to generate the "create table" sql statement for an existing table in postgreSQL

Posted by Raja on Stack Overflow See other posts from Stack Overflow or by Raja
Published on 2010-04-07T15:38:29Z Indexed on 2010/04/07 15:53 UTC
Read the original article Hit count: 189

Filed under:

I have a table created long ago in postgreSQL. Now i want to look at the sql statement used to create it but cannot figure it out.

Also when i do the \dS+ tablename it says table not found, but \dt+ tablename is working fine. The \dS+ lists all the table names owned by the root postgres user and doesn't show up tables that i created with my user account.

Any help is greatly appreciated.

Thanks

© Stack Overflow or respective owner

Related posts about postgresql