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 1rAcSX-007Qis-GF for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2023 20:56:01 +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 1rAcSW-0063tQ-6k for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2023 20:56:00 +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 1rAcSV-0063tI-Or for pgsql-hackers@lists.postgresql.org; Tue, 05 Dec 2023 20:55:59 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rAcSS-00AHMb-Qb for pgsql-hackers@postgresql.org; Tue, 05 Dec 2023 20:55:59 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-77d85cf1ff5so382411085a.0 for ; Tue, 05 Dec 2023 12:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1701809754; x=1702414554; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cmUlioq1rmeFbuVX1jAjcKja5DhD1AkdHkB8zRuEOW0=; b=IBHYrd21Ohl8hIGopiw2fm8BohNVwR/uU+5kbBTiBzRRFoaqsbzQK5pEuPPp9Mn0z+ MZWqohcUcO9W1YFSzhsAOoewGBLTBf46flu6JlEDGFjak/yneLRDNKilj9HqbkqYJWzt 2+IZ37ChNtySUacluQamV9AIK0OK44W/6INZnW4dnoVkkUNH+KEXm6b/Uz+4R3KZh7g6 EjfKKOlnlmDejsDpj4UA4qAmRfDafZc2vuXQjCK5LAWDUMS9XADxloUsbYKDjNhlEmFU HhDV6z//5KxFsBg6YGqH5GVP8OnNn/OTk8pUl13uOMR7hNV6ncugu47/3cE1bn4+ObaA EM0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701809754; x=1702414554; h=content-transfer-encoding:in-reply-to:from:references:cc: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=cmUlioq1rmeFbuVX1jAjcKja5DhD1AkdHkB8zRuEOW0=; b=aaDn9PDUNVqzQMWeRlsxVPKtt4q5ZOpzPRXbjJULTQLKEBp9sxq0+H0WpJeluohinX 3UXK3iKWluZzdw74yfejHlzS+vIFknk8Jwiw8NVcVhhs9k0iIzsFTGingNmkXb2CMxFx MYFI24qmCh63G4UqrwYoE/U4bJKs+cEVPEk2d/KyOrr4M4YWmZyMPTTnxdqMcpA4ZJWy BEAR+heLykoFSXIIvHLwL5LfevUX1zZ1xxPojtIC8Ym/JZIgpcXYyioKcvebX9PaTXCM YoNIV+TQe6mHL59Rb9Gk6OlZ6Wx53n8ySnEeMZhe2Rbt6xCHeCzihM4Ds6eCQa/NsDRN WSqA== X-Gm-Message-State: AOJu0YxTj4+/lGJiwCP20I62A6FcK7mmZgrGr8WwRbtNrXrYE1vxLe3g FFzxczSJfGqt4DhJ1648j/Fx2w== X-Google-Smtp-Source: AGHT+IEHD0Z8rki0hhrYDiAbI7Qk9ysETX84z0V/nDDLgi3QrMVJ4UOxJz4ztguroah3Tf1ye5c+vw== X-Received: by 2002:a05:620a:688c:b0:77e:fba3:a1fc with SMTP id rv12-20020a05620a688c00b0077efba3a1fcmr2176742qkn.86.1701809754710; Tue, 05 Dec 2023 12:55:54 -0800 (PST) Received: from ?IPV6:2605:a601:91bc:f600::2bb? ([2605:a601:91bc:f600::2bb]) by smtp.googlemail.com with ESMTPSA id bp9-20020a05620a458900b00767d4a3f4d9sm5349335qkb.29.2023.12.05.12.55.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Dec 2023 12:55:54 -0800 (PST) Message-ID: <2554e520-e103-8978-dcb5-807dfeb77402@dunslane.net> Date: Tue, 5 Dec 2023 15:55:53 -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: Davin Shearer , PostgreSQL-development Cc: Joe Conway References: <7117a356-916c-4cf3-bad8-861490e65dcf@joeconway.com> <9c77b6fa-ee88-b2e6-0fa7-4fc81721da35@dunslane.net> <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> From: Andrew Dunstan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-12-05 Tu 14:50, Davin Shearer wrote: > Hi Joe, > > In reviewing the 005 patch, I think that when used with FORCE ARRAY, > we should also _imply_ FORCE ROW DELIMITER.  I can't envision a use > case where someone would want to use FORCE ARRAY without also using > FORCE ROW DELIMITER.  I can, however, envision a use case where > someone would want FORCE ROW DELIMITER without FORCE ARRAY, like maybe > including into a larger array.  I definitely appreciate these options > and the flexibility that they afford from a user perspective. > > In the test output, will you also show the different variations with > FORCE ARRAY and FORCE ROW DELIMITER => {(false, false), (true, false), > (false, true), (true, true)}?  Technically you've already shown me the > (false, false) case as those are the defaults. > > I don't understand the point of FORCE_ROW_DELIMITER at all. There is only one legal delimiter of array items in JSON, and that's a comma. There's no alternative and it's not optional. So in the array case you MUST have commas and in any other case (e.g. LINES) I can't see why you would have them. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com