Re: Feature: give pg_dump a WHERE clause expression

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Davy Durham <pubaddr5(at)davyandbeth(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Feature: give pg_dump a WHERE clause expression
Date: 2008-06-02 02:19:37
Message-ID: 20080602021937.GI31154@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

* Davy Durham (pubaddr5(at)davyandbeth(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-06-02 02:47:34 Re: Feature: give pg_dump a WHERE clause expression
Previous Message Davy Durham 2008-06-02 02:05:32 Re: Feature: give pg_dump a WHERE clause expression