From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: psql's \copy incompatible with :variables
Date: Thu, 13 Oct 2011 22:10:41 -0400
Message-ID: <11634.1318558241@sss.pgh.pa.us> (raw)
In-Reply-To: <201110140139.p9E1dHN00659@momjian.us>
References: <201110140139.p9E1dHN00659@momjian.us>
Bruce Momjian <bruce@momjian.us> writes:
> Josh Berkus wrote:
>> Note that psql variables work perfectly fine with COPY. It's just \copy
>> which seems to be misbehaving.
> The problem is that none of the backslash commands interpret variables:
Nonsense.
regression=# \set foo bar
regression=# \d foo
Did not find any relation named "foo".
regression=# \d :foo
Did not find any relation named "bar".
\copy is different because it uses OT_WHOLE_LINE mode to read the
argument, and that doesn't expand :variable references. I'd be a bit
leery of changing that.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, josh@agliodbs.com
Subject: Re: psql's \copy incompatible with :variables
In-Reply-To: <11634.1318558241@sss.pgh.pa.us>
References: <201110140139.p9E1dHN00659@momjian.us> <11634.1318558241@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox