[BUGS] BUG #14493: psql command : Unable to use set with \copy

Поиск
Список
Период
Сортировка
От maxandreogeret@gmail.com
Тема [BUGS] BUG #14493: psql command : Unable to use set with \copy
Дата
Msg-id 20170112094750.24292.7814@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: [BUGS] BUG #14493: psql command : Unable to use set with \copy  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14493
Logged by:          Maxandre Ogeret
Email address:      maxandreogeret@gmail.com
PostgreSQL version: 9.4.1
Operating system:   Redhat
Description:

Hello.

When launching a .sql file from batch script with psql command you can't
pass a variable with set.

batch file :
parameter=$1

psql -h XXX -U XXX -d XXX $@ --set foo=$parameter


SQL file :
\COPY ( SELECT * FROM table where id = :'foo') TO 'out.lst' WITH DELIMITER
AS '|' NULL AS 'ISNULL';

This won't work. but \qecho :'foo'

Will work.

Thanks for your reading.



--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: [BUGS] Problem with declarative partitioning and COPY FROM
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #14493: psql command : Unable to use set with \copy