Re: COPY .... (FORMAT binary) syntax doesn't work

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY .... (FORMAT binary) syntax doesn't work
Date: 2013-05-27 10:31:38
Message-ID: CA+U5nMLXsBwFWAeK5rNgspckrb=RKSuu38=0pmNqoS4QBowQ1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 26 May 2013 16:35, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> wrote:

>> My attempts to fix that look pretty ugly, so I'm not even going to
>> post them. I can stop the error on binary by causing errors on csv and
>> text, obviously not a fix. Any grammar based fix looks like it would
>> restrict the list of formats, which breaks the orginal intention of
>> the syntax change.
>
>
> This seems to work:

This was almost exactly the fix I described above that only fixes that
specific case and then breaks others.

> --- a/src/backend/parser/gram.y
> +++ b/src/backend/parser/gram.y
> @@ -2528,3 +2528,7 @@ copy_generic_opt_elem:
> {
> $$ = makeDefElem($1, $2);
> }
> + | ColLabel BINARY
> + {
> + $$ = makeDefElem($1, (Node *)
> makeString("binary"));
> + }

So, no that doesn't work.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Simon Riggs 2013-05-27 10:37:26 Re: [HACKERS] COPY .... (FORMAT binary) syntax doesn't work
Previous Message stronny 2013-05-27 09:27:01 BUG #8177: initscript should create /var/run/postgresql

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-05-27 10:37:26 Re: [HACKERS] COPY .... (FORMAT binary) syntax doesn't work
Previous Message Ben Zeev, Lior 2013-05-27 10:25:17 Re: PostgreSQL Process memory architecture