Re: Generate SQL Statements

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Terry Lee Tucker <terry(at)chosen-ones(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Generate SQL Statements
Date: 2008-06-04 00:10:43
Message-ID: 4845DD83.10500@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Terry Lee Tucker wrote:
> Greetings:
>
> I was wondering if anyone knows of a third party product that will generate
> SQL statements for creating existing tables. We have to provide table
> definition statements for out parent company. Any ideas?
>
Why 3rd party? How about:

pg_dump --schema-only -t table_name... ?

Alternately, roll-your-own using the system tables. A good place to
start is by running psql with the --echo-queries option to see the
queries it runs "behind the scenes". You can read the queries for things
like "\d+ tablename" then modify them to suit.

Cheers,
Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sushant Sinha 2008-06-04 00:14:32 Re: [GENERAL] Fragments in tsearch2 headline
Previous Message Albretch Mueller 2008-06-04 00:04:10 How to just "link" to some data feed