Re: Emitting JSON to file using COPY TO - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Emitting JSON to file using COPY TO
Date
Msg-id 20231202215320.GA1855278@nathanxps13
Whole thread Raw
In response to Re: Emitting JSON to file using COPY TO  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Emitting JSON to file using COPY TO
List pgsql-hackers
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.

diff --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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal obfuscate password in pg logs
Next
From: Daniel Gustafsson
Date:
Subject: Re: about help message for new pg_dump's --filter option