Re: Feature: give pg_dump a WHERE clause expression - Mailing list pgsql-patches

From Stephen Frost
Subject Re: Feature: give pg_dump a WHERE clause expression
Date
Msg-id 20080602021937.GI31154@tamriel.snowman.net
Whole thread Raw
In response to Re: Feature: give pg_dump a WHERE clause expression  (Davy Durham <pubaddr5@davyandbeth.com>)
Responses Re: Feature: give pg_dump a WHERE clause expression
List pgsql-patches
* Davy Durham (pubaddr5@davyandbeth.com) wrote:
> No, the database I'm loading into is not PostgreSQL, but that's okay.  I
> think that was someone else.

This gets back to the other question then- what database is it and does
it support CSV or XML imports?

> > Of course, on the other hand, you *could* use COPY to create SQL INSERT
> > statements through an appropriately crafted query.  PG makes that
> > reasonably straight-forward, actually.

This is an option too, of course..
select
'insert into XYZ VALUES (' ||
coalesce(quote_literal(col1),'NULL') || ',' ||
coalesce(quote_literal(col2),'NULL') || ');';

or so.  I suppose it might be interesting to consider an 'insert-format'
output for COPY, which pg_dump could possibly be refactored to use when
requested.  It'd be nice if it was easier to have COPY support more
formats but right now it's kind of a pain.

    Stephen

Attachment

pgsql-patches by date:

Previous
From: Davy Durham
Date:
Subject: Re: Feature: give pg_dump a WHERE clause expression
Next
From: Tom Lane
Date:
Subject: Re: Feature: give pg_dump a WHERE clause expression