Re: table dump function - Mailing list pgsql-general

From Adrian Klaver
Subject Re: table dump function
Date
Msg-id 5138BAB9.2010401@gmail.com
Whole thread Raw
In response to table dump function  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
Responses Re: table dump function
List pgsql-general
On 03/07/2013 07:58 AM, Little, Douglas wrote:
> I need a pl/pgsql function that will dump a table ddl  so I can export
> the definition to a file  before I drop the object.
>
> the psql \d command won’t work, since it doesn’t dump the table ddl, it
> just lists the table’s attributes and indexes.
>
> I’ve got the function mostly working,  but need help translating the ACL
> list into the grant commands.
>
> Are there any standard PG functions that would be useful  for creating
> the grants?


pg_dump -U some_user -t some_table -s -f some_table.sql some_database

http://www.postgresql.org/docs/9.2/interactive/app-pgdump.html
>
> Thanks in advance.
>
> *Doug Little*



--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: "Little, Douglas"
Date:
Subject: table dump function
Next
From: "Little, Douglas"
Date:
Subject: Re: FW: statement failure