Looking for a "show create table <name>" equivalent

From: "B(dot)Rathmann" <B(dot)Rathmann(at)ping(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Looking for a "show create table <name>" equivalent
Date: 2011-07-12 08:33:01
Message-ID: 4E1C06BD.5080606@ping.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I've been trying to find out how to find out which sql was run to create
a certain table. As I need this in a program which may access the
database remotely, using pg_dump --schema-only or psql is not an option
(the system my program runs on may not even have those tools installed).
Looking at the source of pgadmin3 it seems as if the program collects
all info about the given table (columns, indeces etc) and creates the
needed SQL by itself, is there no easier way?

E.g. MySQL offers a simple "show create table <name>". I am using
Postgresql 9.0.4 on Gentoo.

Thanks for your help (if there is any documentation which I haven't
found yet, just point me to it).

Sincerely
Bettina

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jose Ig Mendez 2011-07-12 12:50:42 newbie question * compare integer in a "where IN" statement
Previous Message Viktor Bojović 2011-07-11 22:56:25 Re: overload