Re: Get object creation sql script in psql client - Mailing list pgsql-general

From Jasen Betts
Subject Re: Get object creation sql script in psql client
Date
Msg-id gl7263$p40$1@reversiblemaps.ath.cx
Whole thread Raw
In response to Get object creation sql script in psql client  (Igor Katson <descentspb@gmail.com>)
List pgsql-general
On 2009-01-20, Igor Katson <descentspb@gmail.com> 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 --table=foo --schema-only

I realise this is not what exactly you asked for, nor does it give the
most efficient SQL for many tables.




pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: import sql dump with psql - language creation throws error
Next
From: Herouth Maoz
Date:
Subject: Re: Slow update