Re: Looking for a "show create table " equivalent

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Looking for a "show create table " equivalent
Дата
Msg-id ivmg0m$2ip$1@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Looking for a "show create table " equivalent  ("B.Rathmann" <B.Rathmann@ping.de>)
Ответы Re: Looking for a "show create table " equivalent
Список pgsql-sql
On 2011-07-12, B.Rathmann <B.Rathmann@ping.de> wrote:
> Hello,
>
> I've been trying to find out how to find out which sql was run to create
> a certain table. 

That's like trying to find what change was used to create $1.83 

there several possible answers all but one of them wrong, but many of
them may .

> 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).

why do you think you need this information?

> 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.

can you find what you need to know in the information schema?

http://www.postgresql.org/docs/8.4/static/information-schema.html

It's an industry standard, and thus should work with every SQL database.



-- 
⚂⚃ 100% natural



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

Предыдущее
От: "Oliveiros d'Azevedo Cristina"
Дата:
Сообщение: Re: [NOVICE] Compare rows
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Looking for a "show create table " equivalent