| From: | Bruce Momjian <bruce(at)momjian(dot)us> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(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:13:03 |
| Message-ID: | 201110140213.p9E2D3R10837@momjian.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Tom Lane wrote:
> 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.
Oh, I see. My tests were wrong. Thanks.
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Vishnu S. | 2011-10-14 04:29:04 | Re: Tablespace files deleted in continuous run |
| Previous Message | Tom Lane | 2011-10-14 02:10:41 | Re: psql's \copy incompatible with :variables |