Re: running \copy through perl dbi ?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: running \copy through perl dbi ?
Дата
Msg-id CAKFQuwY6BfaE7MtDfZA41SOKmKHLMw-ZXU=YbZ=HLqyE-8uCaw@mail.gmail.com
обсуждение исходный текст
Ответ на running \copy through perl dbi ?  (David Gauthier <dfgpostgres@gmail.com>)
Список pgsql-general
On Fri, Dec 8, 2023 at 8:45 AM David Gauthier <dfgpostgres@gmail.com> wrote:

I'm trying to run a PG client side "\copy" command from a perl script.  I tried using $dbh->do("\\copy ...") but it barffed when it saw the '\'...
ERROR:  syntax error at or near "\"

More accurately it is the psql application's meta-command.  There is no such thing as a generic client side command.

I can do this with a command line approach, attaching to the DB  then run using...
-c "\copy ...".  But I was wondering if there is a more elegant way to do this, maybe some sort of legal SQL command that Perl/DBI would swallow ???

 
The SQL command is just "COPY".  Search for how your driver exposes working with that command/protocol.

David J.

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

Предыдущее
От: David Gauthier
Дата:
Сообщение: running \copy through perl dbi ?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: running \copy through perl dbi ?