Re: [GENERAL] Get object creation sql script in psql client

2009-01-21 Thread Jasen Betts
On 2009-01-20, Igor Katson wrote: > Is there a way to get i.e. table creation sql script from an existing > table in psql (not postgresql, but psql client), like it is in pgAdmin? > > I.e. i point it to existing table 'foo', and it writes: > CREATE TABLE foo ( >bar int > ); pg_dump dbname --

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread A. Kretschmer
In response to Igor Katson : > Is there a way to get i.e. table creation sql script from an existing > table in psql (not postgresql, but psql client), like it is in pgAdmin? > > I.e. i point it to existing table 'foo', and it writes: > CREATE TABLE foo ( > bar int > ); wait for 8.4: http://de

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Grzegorz Jaśkiewicz
try exhausting possibilities there. Many ppl don't know that you can have multiple -t objects , and than use -T for stuff you don't want as well. It does the job pretty often I have to say. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Igor Katson
Grzegorz Jaśkiewicz wrote: pg_dump -t ANYOBJECT database afaik., try it - play with it. that does not work for indices. But the index creation is shown when placing it's parent table into -t. Thanks for the help, Grzegorz, the issue is solved. -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Grzegorz Jaśkiewicz
pg_dump -t ANYOBJECT database afaik., try it - play with it. -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Igor Katson
Grzegorz Jaśkiewicz wrote: pg_dump -t foo database Thanks, but pg_dump is not psql client (i meant the */bin/psql interactive shell), and there is only an option for table objects, and no one for i.e. indices. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

Re: [GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Grzegorz Jaśkiewicz
pg_dump -t foo database -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Get object creation sql script in psql client

2009-01-20 Thread Igor Katson
Is there a way to get i.e. table creation sql script from an existing table in psql (not postgresql, but psql client), like it is in pgAdmin? I.e. i point it to existing table 'foo', and it writes: CREATE TABLE foo ( bar int ); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.