Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rB0pH-0095bB-Vy for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 22:57:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rB0pG-00D58J-4N for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 22:57:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rB0pF-00D57p-Qw for pgsql-hackers@lists.postgresql.org; Wed, 06 Dec 2023 22:57:05 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rB0pC-00ASdu-Ui for pgsql-hackers@postgresql.org; Wed, 06 Dec 2023 22:57:04 +0000 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3b9db318839so233380b6e.3 for ; Wed, 06 Dec 2023 14:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701903420; x=1702508220; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pPppcX9nXGAwLgqJ5HTdPUpl4k0H0XcWNt12p4caR6M=; b=lY04S0hlQCsoR9W5Jy6hvtqGLpSSK0RVCDeZ2ENsV6SgvQ7JHm3psPS9hgM5H4nS6Y vbOgObN+6X14vD/bGbbYL/U6fnBqhboiPJu2HVqZI8+NmV8AI5sc0/+lg8p9sRTaI8fD z4dC8Yghdl1NGT161Je7PxSRUhT+L2Qv5rmQC3kxlQ3XIbC+Yw+qhHoj0aIePk3Tlsk1 62LD1Fh3J4IX/HBoRof2YVA3nZ+qVWPB2D/lipJayxXRFoqTPd1/1GVJgcBhMbJSdsb+ QCbGxdnlpvDFtTdAbQgMBZP02jb3+wiyZLO3wUz/+y3GWUDlfFKvqKs4lAK6H7hgWD7w kFzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701903420; x=1702508220; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pPppcX9nXGAwLgqJ5HTdPUpl4k0H0XcWNt12p4caR6M=; b=OplBOnmP+JkUhc7A/zUppD++wTpjczs3rfe3x0G86VrxMVz0dUnfOtW8AkYLTwJ1xT p4J+lTDEZ4xpzsvGJ81zCI6wyHGfzQYd5hNrXo57eezOdiOEqYtlnunX6wC1HoZsje4A bmtpeKoT8BfJoP8GCn9g1rKVrkO+wV9whaD3J50Twcs3qxD1lPuMWbGYEPkRCAW0Pz1L BzbBDj/E0buIiffJpJSfDOqwERjWE+8w+ipcpigCZADgdaqYcfJ37UgsvE4rMqEn4u2z FsB+puNgypb4VsTBtI0peherhZicgY0REJ2OSKxti6Rt7B+RgBlFl5kSgnbLNHTr9PzA vO1Q== X-Gm-Message-State: AOJu0YyEDR6kLrk6dNvwyUd8NRjOdPZ60XNC4pWIZPk5AUh+kMicFGET GoQ0meELpim9XELcH8+nMtjv0E9TA5BOXw82gzDoSKiL X-Google-Smtp-Source: AGHT+IEwoeckI1icgl03VuKN4KMAtcN2/NgqqvD5uNBbSvtUXspOwWpZdZzZtUXTcmgMVFtz6iVuH9vgZ38/dG5C3Pg= X-Received: by 2002:a05:6870:6120:b0:1fb:75a:c426 with SMTP id s32-20020a056870612000b001fb075ac426mr1690374oae.79.1701903420363; Wed, 06 Dec 2023 14:57:00 -0800 (PST) MIME-Version: 1.0 References: <398c22f6-4299-4b17-80bf-2f14f4afd592@joeconway.com> <46cc4507-a0d9-4044-b2ce-5a8bca8015c0@joeconway.com> <2554e520-e103-8978-dcb5-807dfeb77402@dunslane.net> <926ff917-8371-40ec-b5e6-ab7b0e09bdc5@joeconway.com> <315b81d4-4b67-7828-0355-3808cd14acd1@dunslane.net> <7a60faf6-e7f1-419d-aee6-10a78ea2fe81@joeconway.com> <2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net> <1104915.1701877459@sss.pgh.pa.us> <19a5f9d8-bd1f-9e51-0f5b-510c1189a8a7@dunslane.net> <4d5688f4-9582-4093-8448-e1867bc9e2bc@joeconway.com> <4ad29199-361f-4740-a919-12080ad5ed65@joeconway.com> In-Reply-To: <4ad29199-361f-4740-a919-12080ad5ed65@joeconway.com> From: "David G. Johnston" Date: Wed, 6 Dec 2023 15:56:22 -0700 Message-ID: Subject: Re: Emitting JSON to file using COPY TO To: Joe Conway Cc: Sehrope Sarkuni , Andrew Dunstan , Tom Lane , Davin Shearer , PostgreSQL-development Content-Type: multipart/alternative; boundary="000000000000d01983060bdf4488" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d01983060bdf4488 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 6, 2023 at 3:38=E2=80=AFPM Joe Conway wrot= e: > So the questions are: > 1. Do those two formats work for the initial implementation? > Yes. We provide a stream-oriented format and one atomic-import format. 2. Is the default correct or should it be switched > e.g. rather than specifying FORCE_ARRAY to get an > array, something like FORCE_NO_ARRAY to get JSON lines > and the JSON array is default? > > No default? Require explicit of a sub-format when the main format is JSON. JSON_OBJECT_ROWS JSON_ARRAY_OF_OBJECTS For a future compact array-structured-composites sub-format: JSON_ARRAY_OF_ARRAYS JSON_ARRAY_ROWS David J. --000000000000d01983060bdf4488 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 6, 2023 at 3:38=E2=80=AFPM Joe Conway <mail@joeconway.com> wrote:<= br>
So the questions are:
1. Do those two formats work for the initial implementation?

Yes.=C2=A0 We provide a stream-oriented format and= one atomic-import format.

2. Is the default correct or should it be switched
=C2=A0 =C2=A0 e.g. rather than specifying FORCE_ARRAY to get an
=C2=A0 =C2=A0 array, something like FORCE_NO_ARRAY to get JSON lines
=C2=A0 =C2=A0 and the JSON array is default?


<= /div>
No default?

Require explicit of a sub-format w= hen the main format is JSON.

JSON_OBJECT_ROWS
= JSON_ARRAY_OF_OBJECTS

For a future compact array-stru= ctured-composites sub-format:
JSON_ARRAY_OF_ARRAYS
JSON_AR= RAY_ROWS

David J.
--000000000000d01983060bdf4488--