\copy and identifier quoting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: \copy and identifier quoting
Date: 2002-10-12 20:57:42
Message-ID: 14168.1034456262@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2002-10-12 21:42:34 Debugging bootstrap
Previous Message Tom Lane 2002-10-12 20:36:44 \copy needs work (was Re: Changing Column Order)