Re: psql's \copy incompatible with :variables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: psql's \copy incompatible with :variables
Date: 2011-10-14 02:10:41
Message-ID: 11634.1318558241@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2011-10-14 02:13:03 Re: psql's \copy incompatible with :variables
Previous Message Bruce Momjian 2011-10-14 01:39:17 Re: psql's \copy incompatible with :variables