Re: [BUGS] COPY .... (FORMAT binary) syntax doesn't work - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [BUGS] COPY .... (FORMAT binary) syntax doesn't work
Date
Msg-id CA+U5nMLXsBwFWAeK5rNgspckrb=RKSuu38=0pmNqoS4QBowQ1Q@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] COPY .... (FORMAT binary) syntax doesn't work  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On 26 May 2013 16:35, Heikki Linnakangas <hlinnakangas@vmware.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



pgsql-hackers by date:

Previous
From: "Ben Zeev, Lior"
Date:
Subject: Re: PostgreSQL Process memory architecture
Next
From: Simon Riggs
Date:
Subject: Re: [BUGS] COPY .... (FORMAT binary) syntax doesn't work