Re: Modifying COPY TO

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Modifying COPY TO
Дата
Msg-id 200502260155.j1Q1txZ22244@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Modifying COPY TO  ("Jim C. Nasby" <decibel@decibel.org>)
Список pgsql-hackers
Jim C. Nasby wrote:
> Instead of just being able to specify an index to use, how hard would it
> be to allow COPY TO to work from a generic query instead of just a
> table? That way you wouldn't need to do a diff, you could just export
> only new records. ISTM there's far more use for copying from a query
> result that just copying by index order.

The reason we don't support queries with COPY is because COPY reads from
the raw heap rather than going through the executor.  We could
special-case it so queries go through the executor but would take a
little work.

The only trick I can think of for now is to use SELECT ... INTO
TEMPORARY tab ... oRDER BY and then use COPY to dump the table.  It will
then dump in the order of the ORDER BY.


--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: idea for concurrent seqscans
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: idea for concurrent seqscans