From: Tom Lane <tgl@sss.pgh.pa.us>
To: Phillip Smith <phillip.smith@weatherbeeta.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: pg_dump using SQL
Date: Tue, 18 Mar 2008 23:01:53 -0400
Message-ID: <20891.1205895713@sss.pgh.pa.us> (raw)
In-Reply-To: <001b01c8894f$2c2ae710$9b0014ac@wbaus090>
References: <001b01c8894f$2c2ae710$9b0014ac@wbaus090>
"Phillip Smith" <phillip.smith@weatherbeeta.com.au> writes:
>> Is there any way to do what pg_dump does?, I mean, get the structure of a
>> table in a database (ex: CREATE TABLE ...)
> Turn Query Logging on in postgresql.conf then see what queries are executed
> by pgAdmin or similar when you run it?
But note that these queries are moving targets: they frequently change
from one PG version to the next.
By far the best answer, if you can use it, is to invoke pg_dump itself
as a subprocess. Something like "pg_dump -s -t mytable ..." for
instance.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, phillip.smith@weatherbeeta.com.au
Subject: Re: pg_dump using SQL
In-Reply-To: <20891.1205895713@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox