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 1rMvQb-007jTe-Gt for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2024 19:36:54 +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 1rMvQY-007APo-Tf for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jan 2024 19:36:50 +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 1rMvQY-007APf-KI for pgsql-hackers@lists.postgresql.org; Mon, 08 Jan 2024 19:36:50 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rMvQV-000X3A-KA for pgsql-hackers@postgresql.org; Mon, 08 Jan 2024 19:36:49 +0000 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-3606ad581a5so11413895ab.1 for ; Mon, 08 Jan 2024 11:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704742606; x=1705347406; 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=rqBof83EYCwiojArRZ4XrkVa17/I6LPE5Cdv+rwILOs=; b=OOChHimVJ8b5vfUXe5XyE4Mskjm4C2XcWBvqka5MWfw8gdQs9b6hS/iVJH+yT2xszf MIb59Xdjg8SK1xvj3bzg4SNddbF7eTkKbd6Q9N6JlUkWi1ZVKeQJ3du7mQLBLFZS3iSj GuQPirbRXF/y0ehllx29YAwKy9MK5wuaSRmRJsBKOUJie4Sbayc+e668jcIMjhQSuRSG cbQgh6FetJtqJt1KsNsGl3Bp3OmmZ+qeDwXwztRYA04chDlOx1uJqpOmfR1XVEjc+LM4 nIe5q9T9TCfHAyyZRqIt4OVEXUqnnkXR3l9hzpDdjSIY90yc6aYJJY4/r5pDDZqCKRx5 n90Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704742606; x=1705347406; 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=rqBof83EYCwiojArRZ4XrkVa17/I6LPE5Cdv+rwILOs=; b=iZ5M0BWYIAlbnH+3cu9p8BQskf9LXjUW2bOdXDHRpwA7BAkiyIQUOS6bIHGmarpngP F0yLY0j5UjBbaUCHqzJem4gThDNfAS0YwWt8ivSbFlA6qPqKJnMFEjAnaxbt7vnCCSn2 tCGQ2fJS0rWfQy0w6YH5wu5EerjoUu9a9ib+eAuxnc40sEi0eBM1grRxr4yRpVfp4u7Q 44MVTVAw3+5hKUD89c6pvdlP0W2fhPmYFTUHVqK8VmhdjMFL48j3caHFQi3LCak+ZRCc KyhOde5rgw2YCFzLaN2rsWBXykfltPgIdBzAi9EloiUvCJ9d8QbINKD+n/O0pniLB/53 Ve9Q== X-Gm-Message-State: AOJu0Yw45oF/XbkX4DDViHpbLg4xynl9IanoBXOge6DkHG+3v0w+K6o2 Ge2Flc7cWl6nD+hNSvgbcrquVp3tlii4+lRkuXHSAE4WeGa8/A== X-Google-Smtp-Source: AGHT+IEBzQiFkFYHm8r0f5btJzpGkIUaSJLptgkGZpKm/JImx6v36ShrhQCMOBsKS/Bhp/+CfULVh2Cj9yDoAkQHoRc= X-Received: by 2002:a05:6e02:19cb:b0:360:6ab:1026 with SMTP id r11-20020a056e0219cb00b0036006ab1026mr4634327ill.41.1704742606485; Mon, 08 Jan 2024 11:36:46 -0800 (PST) MIME-Version: 1.0 References: <8620df11-96e4-4ca3-8f3c-33a479260961@joeconway.com> <4162f7f7-6fd6-4720-98e2-89f80e3de2ed@joeconway.com> In-Reply-To: <4162f7f7-6fd6-4720-98e2-89f80e3de2ed@joeconway.com> From: Dean Rasheed Date: Mon, 8 Jan 2024 19:36:34 +0000 Message-ID: Subject: Re: Emitting JSON to file using COPY TO To: Joe Conway Cc: Daniel Verite , Andrew Dunstan , Davin Shearer , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 7 Dec 2023 at 01:10, Joe Conway wrote: > > The attached should fix the CopyOut response to say one column. > Playing around with this, I found a couple of cases that generate an error: COPY (SELECT 1 UNION ALL SELECT 2) TO stdout WITH (format json); COPY (VALUES (1), (2)) TO stdout WITH (format json); both of those generate the following: ERROR: record type has not been registered Regards, Dean