Re: COPY command question

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: COPY command question
Дата
Msg-id 20090211184502.GK3008@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на COPy command question  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
Ответы Re: COPY command question  (Kedar <kedarr@netcore.co.in>)
Список pgsql-general
On Wed, Feb 11, 2009 at 10:22:23AM -0800, Sharmila Jothirajah wrote:
> I want to migrate my tables from Oracle to Postgres.
> The COPY FROM command can take input from 'file' or 'STDIN'.
> Is it possible for the COPY command to take its input from a
> java program(which contains the oracle resultset) or any other way?

"STDIN" just means from the same place as the rest of the SQL has come
from.  For example, if you're using JDBC, it would be possible do
generate a string containing:

  COPY tbl (col1,col2) FROM STDIN WITH CSV;
  1,2
  4,7
  12,37
  \.

and execute() the whole string.  There appear to be patches[1] available so
you can stream directly into the database rather than having to generate
a large strings to pass in.

--
  Sam  http://samason.me.uk/

 [1] http://kato.iki.fi/sw/db/postgresql/jdbc/copy/

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: postmaster LISTENing on UDP port 32938
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postmaster LISTENing on UDP port 32938