On Apr 11, 2011, at 7:55, Francisco Leovey wrote:
> Hello
>
> For a new project where I am running 2 versions of Postgres (8.4 and 9.0) simultaneously on an Ubuntu server:
> I need the syntax of an SQL statement in order to create tables and all index from one database to the other via a
utilityprogram I have in Perl.
> I see PgAdmin shows on the lower pane all the SQL needed to create a table and all its index, but I do not know how
toobtain that info.
> It would be optimal if I can get all the info in a single query (the way pgdump does).
> Also I need the SQL to create all the SEQUENCES.
Can you call pg_dump?
pg_dump -s -t your_table
Otherwise, I recommend taking a look at the pg_dump source code.
Michael Glaesemann
grzm seespotcode net