pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.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:13:03 -0400 (EDT)
Message-ID: <201110140213.p9E2D3R10837@momjian.us> (raw)
In-Reply-To: <11634.1318558241@sss.pgh.pa.us>

Tom Lane wrote:
> 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.

Oh, I see.  My tests were wrong.  Thanks.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +



view thread (7+ messages)  latest in thread

Message-ID: <201110140213.p9E2D3R10837@momjian.us>
Permalink:  ../201110140213.p9E2D3R10837@momjian.us/
Also on:    postgresql.org/message-id/201110140213.p9E2D3R10837@momjian.us

 · 

reply

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: bruce@momjian.us, tgl@sss.pgh.pa.us, josh@agliodbs.com
  Subject: Re: psql's \copy incompatible with :variables
  In-Reply-To: <201110140213.p9E2D3R10837@momjian.us>
  References: <11634.1318558241@sss.pgh.pa.us> <201110140213.p9E2D3R10837@momjian.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