Re: table dump function

From: "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: "PostgreSQL General (pgsql-general(at)postgresql(dot)org)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: table dump function
Date: 2013-03-07 19:09:21
Message-ID: 8585BA53443004458E0BAA6134C5A7FBB6BEB1EA@EGEXCMB01.oww.root.lcl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian,
Thank you for your comments.
This is part of our deployment framework. DDL files are submitted to the framework, which eventually run as psql scripts.

thanks for the tip about pg_dump.c I'll take a look.
I'll also look at escaping out from psql.

Thanks

-----Original Message-----
From: Adrian Klaver [mailto:adrian(dot)klaver(at)gmail(dot)com]
Sent: Thursday, March 07, 2013 12:19 PM
To: Little, Douglas
Cc: PostgreSQL General (pgsql-general(at)postgresql(dot)org)
Subject: Re: [GENERAL] table dump function

On 03/07/2013 08:42 AM, Little, Douglas wrote:
> Thanks for the suggestion Adrian,
>
> Unfortunately, my process is executing from psql, so to start pg_dump from within psql is a bit challenging.
> We have 1 instance where we start an OS process from a function, but it's new territory for us.

Yeah, my suggestion was offered in the spirit of not reinventing the
wheel:) When you say you are running from inside psql, do you mean interactively or from script? As Rob mentioned from psql you can get to the shell by doing \!.

>
> My function is dumping everything but the ACL grant list. I currently have a function that will build and execute the grants from the acl list,
> so it's just a simple exercise to get it to dump the statements.
>
> I was just hoping that there were standard functions for doing this.

Not that I know of. If you feel adventurous you could look at dumpTableSchema in pg_dump.c in the source to see how pg_dump does it.

> Thanks
> doug
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2013-03-07 19:27:41 Re: table dump function
Previous Message Ray Stell 2013-03-07 18:42:36 Re: Trust intermediate CA for client certificates