Thread: BUG #5411: \copy do not work with dot "." in query

BUG #5411: \copy do not work with dot "." in query

From
"Vitalii Tymchyshyn"
Date:
The following bug has been logged online:

Bug reference:      5411
Logged by:          Vitalii Tymchyshyn
Email address:      tivv00@gmail.com
PostgreSQL version: 8.4.3
Operating system:   OpenSuse 11.2: Linux tivv 2.6.31.12-0.1-default #1 SMP
2010-01-27 08:20:11 +0100 x86_64 x86_64 x86_64 GNU/Linux
Description:        \copy do not work with dot "." in query
Details:

dict=> \copy (select 1.0) to test.tst
ERROR:  syntax error at or near "."
LINE 1: COPY ( select 1 . 0 ) TO STDOUT
                        ^
\copy: ERROR:  syntax error at or near "."
LINE 1: COPY ( select 1 . 0 ) TO STDOUT
                        ^


Workaround:
\copy (select 1::float8) to test.tst
works OK.

Re: BUG #5411: \copy do not work with dot "." in query

From
Tom Lane
Date:
"Vitalii Tymchyshyn" <tivv00@gmail.com> writes:
> dict=> \copy (select 1.0) to test.tst
> ERROR:  syntax error at or near "."
> LINE 1: COPY ( select 1 . 0 ) TO STDOUT
>                         ^

This case works as expected in CVS HEAD, apparently because of this fix:
http://archives.postgresql.org/pgsql-committers/2009-09/msg00184.php

I doubt we'd risk backpatching the whole change, but maybe it would
be sensible to backpatch just the changes in the COPY (SELECT) part
(lines 119-137 in HEAD).  Not sure that it's worth taking any risk
for, though, given the lack of previous complaints.

            regards, tom lane