pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joe Conway <mail@joeconway.com>
Cc: Davin Shearer <davin@apache.org>
Cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: Emitting JSON to file using COPY TO
Date: Sat, 2 Dec 2023 15:53:20 -0600
Message-ID: <20231202215320.GA1855278@nathanxps13> (raw)
In-Reply-To: <398150.1701529880@sss.pgh.pa.us>
References: <CAFCRh--Vhx0105S7SWAYHGcVMTSRtbcoArDUGSbYSWRUGunW_g@mail.gmail.com>
	<CAKFQuwZb3zaSqkOvGXRRLZEW61az+4xyHZ7tBPR91JfrcdCKvA@mail.gmail.com>
	<3853387.1701096982@sss.pgh.pa.us>
	<CAFCRh-_GdiUvjd5z5FfvTfhruOnYqBu163XU47zZE8RNATCJGQ@mail.gmail.com>
	<3a98decf-3fe3-4b49-9b68-fda01338872c@sedlakovi.org>
	<CALvfUkCq3pvkmniWEKZwkbA6hNNvkANF3OamMfhC170RgY+HJg@mail.gmail.com>
	<24e3ee88-ec1e-421b-89ae-8a47ee0d2df1@joeconway.com>
	<20231201230958.GA1786735@nathanxps13>
	<411395e0-697e-44ab-be98-dd2047f9a10e@joeconway.com>
	<398150.1701529880@sss.pgh.pa.us>

On Sat, Dec 02, 2023 at 10:11:20AM -0500, Tom Lane wrote:
> So if you are writing a production that might need to match
> FORMAT followed by JSON, you need to match FORMAT_LA too.

Thanks for the pointer.  That does seem to be the culprit.

inline patch 1: src/backend/parser/gram.y (+4/-0 lines) download inline-1.patchdiff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index d631ac89a9..048494dd07 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3490,6 +3490,10 @@ copy_generic_opt_elem: { $$ = makeDefElem($1, $2, @1); } + | FORMAT_LA copy_generic_opt_arg + { + $$ = makeDefElem("format", $2, @1); + } ; copy_generic_opt_arg:
-- Nathan Bossart Amazon Web Services: https://aws.amazon.com

view thread (163+ messages)  latest in thread

Message-ID: <20231202215320.GA1855278@nathanxps13>
Permalink:  ../20231202215320.GA1855278@nathanxps13/
Also on:    postgresql.org/message-id/20231202215320.GA1855278@nathanxps13

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, mail@joeconway.com, davin@apache.org, pgsql-hackers@postgreSQL.org
  Subject: Re: Emitting JSON to file using COPY TO
  In-Reply-To: <20231202215320.GA1855278@nathanxps13>
  References: <CAFCRh--Vhx0105S7SWAYHGcVMTSRtbcoArDUGSbYSWRUGunW_g@mail.gmail.com> <CAKFQuwZb3zaSqkOvGXRRLZEW61az+4xyHZ7tBPR91JfrcdCKvA@mail.gmail.com> <3853387.1701096982@sss.pgh.pa.us> <CAFCRh-_GdiUvjd5z5FfvTfhruOnYqBu163XU47zZE8RNATCJGQ@mail.gmail.com> <3a98decf-3fe3-4b49-9b68-fda01338872c@sedlakovi.org> <CALvfUkCq3pvkmniWEKZwkbA6hNNvkANF3OamMfhC170RgY+HJg@mail.gmail.com> <24e3ee88-ec1e-421b-89ae-8a47ee0d2df1@joeconway.com> <20231201230958.GA1786735@nathanxps13> <411395e0-697e-44ab-be98-dd2047f9a10e@joeconway.com> <398150.1701529880@sss.pgh.pa.us> <20231202215320.GA1855278@nathanxps13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox