Re: Feature: give pg_dump a WHERE clause expression

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Feature: give pg_dump a WHERE clause expression
Дата
Msg-id 20080602021937.GI31154@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Feature: give pg_dump a WHERE clause expression  (Davy Durham <pubaddr5@davyandbeth.com>)
Ответы Re: Feature: give pg_dump a WHERE clause expression
Список 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

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Davy Durham
Дата:
Сообщение: Re: Feature: give pg_dump a WHERE clause expression
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Feature: give pg_dump a WHERE clause expression