psql \set vs \copy - bug or expected behaviour?
От
Richard Huxton
Тема
psql \set vs \copy - bug or expected behaviour?
Дата
Msg-id
4EA15684.8040508@archonet.com
Список
Дерево обсуждения
psql \set vs \copy - bug or expected behaviour? Richard Huxton <dev@archonet.com>
Re: psql \set vs \copy - bug or expected behaviour? Robert Haas <robertmhaas@gmail.com>
Re: psql \set vs \copy - bug or expected behaviour? Bruce Momjian <bruce@momjian.us>
Re: psql \set vs \copy - bug or expected behaviour? Tom Lane <tgl@sss.pgh.pa.us>
Re: psql \set vs \copy - bug or expected behaviour? Richard Huxton <dev@archonet.com>
Re: psql \set vs \copy - bug or expected behaviour? Bruce Momjian <bruce@momjian.us>
Re: psql \set vs \copy - bug or expected behaviour? Bruce Momjian <bruce@momjian.us>
It looks like \copy is just passing the text of the query unadjusted to "COPY". I get a syntax error on ":x" with the \copy below on both 9.0 and 9.1 === test script === \set x '''HELLO''' -- Works \echo :x -- Works \o '/tmp/test1.txt' COPY (SELECT :x) TO STDOUT; -- Doesn't work \copy (SELECT :x) TO '/tmp/test2.txt' === end script === -- Richard Huxton Archonet Ltd
В списке pgsql-hackers по дате отправления
От: Alvaro Herrera
Дата: