Re: COPy command question

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: COPy command question
Дата
Msg-id dcc563d10902121035n6fa1012yae4246f56a6171b9@mail.gmail.com
обсуждение исходный текст
Ответ на COPy command question  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
Ответы Re: COPy command question  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
Список pgsql-general
On Wed, Feb 11, 2009 at 11:22 AM, SHARMILA JOTHIRAJAH
<sharmi_jo@yahoo.com> wrote:
> Hi,
> A question about the Postgresql's COPY command.
>
> This is the syntax of this command from the manual
>
> COPY tablename [ ( column [, ...] ) ]
>     FROM { 'filename' | STDIN }
>     [ [ WITH ]
>          .....
> 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?

If that java program can provide direct input to postgresql then yes.
If everything has to be a prepared statement etc then no.  Assuming
your java framework allows you just throw input at the database, you'd
be able to just give it the input line by line.

> I know I could get the Oracle rows in a csv format but
> Im trying to get it done without any file in between ?
>
> In short is it possible to use this 'COPY' command to migrate my tables'
> data from Oracle to Postgresql without using any file
>  in between?

Sure, I can do it in PHP.  I've done it in PHP.  If your java
connectors have the facility to throw raw sql at pgsql then it should
work.

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

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: How to check if 2 series of data are equal
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Killing OIDs