Re: Need SQL of create TABLE including INDEX and SEQUENCE

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Need SQL of create TABLE including INDEX and SEQUENCE
Дата
Msg-id 3A657E38-E3F3-4D06-A841-281523F8E3B4@seespotcode.net
обсуждение исходный текст
Ответ на Need SQL of create TABLE including INDEX and SEQUENCE  (Francisco Leovey <fleovey@yahoo.com>)
Список pgsql-novice
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




В списке pgsql-novice по дате отправления:

Предыдущее
От: Francisco Leovey
Дата:
Сообщение: Need SQL of create TABLE including INDEX and SEQUENCE
Следующее
От: Mathieu Dubois
Дата:
Сообщение: Re: What does \timing measure?