Re: [BUGS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [BUGS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"
Дата
Msg-id CA+TgmoZebb5-8cnoTdNnCz3=AsqrFkzTuoK2FZAEbe3+rnF42w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: [BUGS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [BUGS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"  (Andrew Dunstan <andrew@dunslane.net>)
Re: [BUGS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"  (Pavel Golub <pavel@microolap.com>)
Список pgsql-hackers
On Tue, Jul 5, 2011 at 11:06 AM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from Pavel Golub's message of mar jul 05 10:52:06 -0400 2011:
>> Hello.
>>
>> System: PostgreSQL v9.0 Windows XP SP3
>> SQL: COPY "tablename" TO STDOUT WITH (FORMAT binary)
>> ERROR:  syntax error at or near "binary"
>> LINE 1: ...OPY "tablename" TO STDOUT WITH (FORMAT binary)
>>                                                   ^
>>
>> ********** Error **********
>>
>> ERROR: syntax error at or near "binary"
>> SQL state: 42601
>> Character: 55
>>
>> But if I use 'FORMAT text' or 'FORMAT csv' all is OK.
>>
>> Suppose this happens because BINARY is not listed in
>> "unreserved_keyword" neither in "col_name_keyword parser" parser rules, but
>> listed in "type_func_name_keyword" instead.
>
> That seems pretty unfortunate.  Of course, it works if you quote it:
>
> COPY "tablename" TO STDOUT WITH (FORMAT "binary")
>
> I assume it's not in unreserved_keyword because it would cause a
> shift/reduce conflict elsewhere.

Yeah.  In particular, it conflicts with the ancient copy syntax which
we still support for backwards compatibility with versions < 7.3.  We
can fix the immediate problem with something like the attached.

(a) Should we do that?

(b) Should we back-patch it to 9.1 and 9.0?

(c) Should we consider removing compatibility with the ancient copy
syntax in 9.2, and de-reserving that keyword?  (Given that the
workaround is this simple, I'm inclined to say "no", but could be
persuaded otherwise.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Golub
Дата:
Сообщение: Re: COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: %ENV warnings during builds