Re: \copy and identifier quoting

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: \copy and identifier quoting
Date: 2002-10-14 03:46:10
Message-ID: 200210140346.g9E3kAh03741@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Isn't this a bug?
>
> regression=# create table FOO (f1 int);
> CREATE TABLE
> regression=# \copy FOO from stdin
> ERROR: Relation "FOO" does not exist
> \copy: ERROR: Relation "FOO" does not exist
> regression=#
>
> This happens because \copy takes the given table name and slaps
> double quotes around it, so the backend gets COPY "FOO" ...
> rather than COPY FOO ...
>
> It seems to me that psql's \copy should interpret the table name
> the same way that a regular SQL command would: honor double quotes,
> downcase in the absence of quotes.
>
> Comments, objections?

Yes, that makes perfect sense.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-10-14 03:47:49 Re: experiences with autocommit functionality in 7.3
Previous Message Bruce Momjian 2002-10-14 03:45:36 Re: \copy needs work (was Re: Changing Column Order)