Re: running \copy through perl dbi ?

Поиск
Список
Период
Сортировка
От Vincent Veyron
Тема Re: running \copy through perl dbi ?
Дата
Msg-id 20231210183924.196759a6e72d0dadf31cf44e@libremen.org
обсуждение исходный текст
Ответ на running \copy through perl dbi ?  (David Gauthier <dfgpostgres@gmail.com>)
Ответы Re: running \copy through perl dbi ?
Список pgsql-general
On Fri, 8 Dec 2023 10:45:28 -0500
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 "\"
>
> I can do this with a command line approach, attaching to the DB  then run
> using...

Duh! I just realized that what I proposed with system() is a command line approach.

As David Johnston mentionned, you can use the SQL COPY command.

However, you need then to deal with permissions so that the server may write the file, so I wonder what approach is
cleaner?


--

                    Bien à vous, Vincent Veyron

https://marica.fr
Logiciel de gestion des contentieux juridiques, des contrats et des sinistres d'assurance




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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Question on overall design
Следующее
От: Vincent Veyron
Дата:
Сообщение: Re: running \copy through perl dbi ?