Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-25 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 02:01:25PM -0400, Bruce Momjian wrote: On Fri, Aug 17, 2012 at 06:55:14PM +0100, Richard Huxton wrote: Well, it'd be nice to allow substitution there ... What we can't easily do is to allow quotes to prevent variable substitution in these whole-line commands

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-17 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Fri, Oct 21, 2011 at 05:31:41PM -0400, Robert Haas wrote: I'm not sure whether that's a bug per se, but I can see where a behavior change might be an improvement. I did some research on this and learned a little more about flex rules. Turns out we

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-17 Thread Richard Huxton
On 17/08/12 18:38, Tom Lane wrote: Bruce Momjianbr...@momjian.us writes: On Fri, Oct 21, 2011 at 05:31:41PM -0400, Robert Haas wrote: I'm not sure whether that's a bug per se, but I can see where a behavior change might be an improvement. I did some research on this and learned a little

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-17 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 06:55:14PM +0100, Richard Huxton wrote: Well, it'd be nice to allow substitution there ... What we can't easily do is to allow quotes to prevent variable substitution in these whole-line commands because we can't process the quotes because that will remove them.

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-16 Thread Bruce Momjian
On Fri, Oct 21, 2011 at 05:31:41PM -0400, Robert Haas wrote: On Fri, Oct 21, 2011 at 7:24 AM, Richard Huxton d...@archonet.com wrote: 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 ===

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2011-10-21 Thread Robert Haas
On Fri, Oct 21, 2011 at 7:24 AM, Richard Huxton d...@archonet.com wrote: 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