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 1rAr8y-008TbK-Ob for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 12:36:48 +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 1rAr8x-009DZu-92 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 12:36:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAr8w-009DZl-Rl for pgsql-hackers@lists.postgresql.org; Wed, 06 Dec 2023 12:36:46 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rAr8p-0094vc-Fj for pgsql-hackers@postgresql.org; Wed, 06 Dec 2023 12:36:45 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b9d2b8c3c6so127809b6e.1 for ; Wed, 06 Dec 2023 04:36:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1701866198; x=1702470998; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bHIlXNL5Kam3qwOrxMmLRmDbvaDHOlyU9qSGN1IO070=; b=PvASyWFdAvX0MkykOY+BaXdgmEWWd2pvJ6RQ+Xe9T1l2ZS2l7PhrQUccDKYYVDS9Zc TmXkcFinu6UoqZTMkdGzn5FQiH9bIGReKweMhZRkEaFPEtyhGiH1QqL13gtqYux2P9Fl fSlrsU44H9LANo4QZUderb2YglyZ/54lRoZ0eHJZKXA2OTnGyJrw2o1i2+GGcrcUbwPj TUKju+wnOe9JDtw2gGXjekpOnQR+jg2QdxDVaANvsAEnL6XWGFS5yxjM+JheCIgLkLyd vkkIIlGdGAaxP/7bgOREzh5xxCChNANYjiTro+hgTwWsDmyGz3OFy7UagH4azPg0j6L1 H0Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701866198; x=1702470998; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bHIlXNL5Kam3qwOrxMmLRmDbvaDHOlyU9qSGN1IO070=; b=oCUUHjVQzNdziwIAhoSos7JE3NRsUfakVZOIzGSPBtGz0WyRrtojRb+GYxr12qUDVn Nsx0pkmBbN6gajl3/kK3+6MGJQfs31DfUm65qQo8hXQWuR6yznv9VRTUTC6d8Dyipxja i1YG5zfSvNulVYtxmCYKeGvjuvx6L/htOUeoB9ZmQdRDkKvkl1sCydAtbolEO3LEUfF6 gWvSSH5yVZJc9bOZBxex5OzsSsB0FEMafLorgaHC3Yw+xpdAgN7eB5Py6ZxhPRHa5/ye 8PHk+7UqFHJBwV1OpqynU1qvLax64AhKz9JZ43Xmp7ZY+NkI0D407DzvhfhalK4BfKCv kyGA== X-Gm-Message-State: AOJu0Yw/0CgVcS6r902Jj52JHsRSHrh2Ust+2fNoQmJgJOo8h3zpu1mI zJa9kocQp5/B3CzWm79oNAwYSg== X-Google-Smtp-Source: AGHT+IGwbbSIgaw399mmBAWdf4EC1oaKmksoHvO/x1dPG63mtx2hKqxqjdOO+/fZ+0eLcY0T5GApow== X-Received: by 2002:a05:6808:17a3:b0:3b8:9025:57d7 with SMTP id bg35-20020a05680817a300b003b8902557d7mr1036677oib.3.1701866197991; Wed, 06 Dec 2023 04:36:37 -0800 (PST) Received: from ?IPV6:2605:a601:91bc:f600::2bb? ([2605:a601:91bc:f600::2bb]) by smtp.googlemail.com with ESMTPSA id br30-20020a05620a461e00b0077d742fb27esm5831714qkb.49.2023.12.06.04.36.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Dec 2023 04:36:37 -0800 (PST) Message-ID: <2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net> Date: Wed, 6 Dec 2023 07:36:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: Emitting JSON to file using COPY TO Content-Language: en-US To: Joe Conway , Davin Shearer , PostgreSQL-development References: <41dcba92-1075-e5e5-cb99-36711abf6cec@dunslane.net> <5c84b70b-ba18-c45d-dbbe-612fa229b2ce@dunslane.net> <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> From: Andrew Dunstan In-Reply-To: <7a60faf6-e7f1-419d-aee6-10a78ea2fe81@joeconway.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-12-05 Tu 16:46, Joe Conway wrote: > On 12/5/23 16:20, Andrew Dunstan wrote: >> On 2023-12-05 Tu 16:09, Joe Conway wrote: >>> On 12/5/23 16:02, Joe Conway wrote: >>>> On 12/5/23 15:55, Andrew Dunstan wrote: >>>>> and in any other case (e.g. LINES) I can't see why you >>>>> would have them. >>> >>> Oh I didn't address this -- I saw examples in the interwebs of MSSQL >>> server I think [1] which had the non-array with commas import and >>> export style. It was not that tough to support and the code as >>> written already does it, so why not? >> >> That seems quite absurd, TBH. I know we've catered for some absurdity in >> the CSV code (much of it down to me), so maybe we need to be liberal in >> what we accept here too. IMNSHO, we should produce either a single JSON >> document (the ARRAY case) or a series of JSON documents, one per row >> (the LINES case). > > > So your preference would be to not allow the non-array-with-commas > case but if/when we implement COPY FROM we would accept that format? > As in Postel'a law ("be conservative in what you do, be liberal in > what you accept from others")? Yes, I think so. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com