psql \set vs \copy - bug or expected behaviour? - Mailing list pgsql-hackers

From Richard Huxton
Subject psql \set vs \copy - bug or expected behaviour?
Date
Msg-id 4EA15684.8040508@archonet.com
Whole thread Raw
Responses Re: psql \set vs \copy - bug or expected behaviour?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: ProcessStandbyHSFeedbackMessage can make global xmin go backwards
Next
From: Robert Haas
Date:
Subject: Re: [v9.2] DROP statement reworks