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 1rV7MI-00Ewz7-A0 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Jan 2024 09:58:18 +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 1rV7MH-00D10E-Bj for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Jan 2024 09:58:17 +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 1rV7MH-00D102-29 for pgsql-hackers@lists.postgresql.org; Wed, 31 Jan 2024 09:58:17 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450: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 1rV7ME-004Izs-FQ for pgsql-hackers@postgresql.org; Wed, 31 Jan 2024 09:58:15 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d0600551ebso15290391fa.2 for ; Wed, 31 Jan 2024 01:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706695093; x=1707299893; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GeCm5xYq0MDVp+CtR30aIuMR1ZyILau8tQX+nKlLBVs=; b=Lx83d2JccurIDOOBw0XYkrSq1k/TXf5pFGD/92ITU0Gzr6cBxReFnIqDJ9pVSj+1hf x8NYVawq5g3zxQ/oPRu2T7NcxSQ9l5YIsgZgbQ+bRolIZcSrg+7rr1XPKq7xw5ZJqIuJ fkUNdrWXxLAAzU527XDlu4lJE6l1NyGHJ581oo2zMGI7gq7d1rCaT6LDAe8fo8Hz6puU ZhwkqrFc04ktBDJwVcBJu9h5YzptaleXmejCWMugpUQ5mesw6AxfvOLd8hwl7saQkBhP 3UfzLXyWJQ84L7IuCVa51RbmevGbyY1Hr48j6d0dY41AtShRZ0J6vCFAo1fB4EJVOp97 w22w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706695093; x=1707299893; h=content-transfer-encoding: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=GeCm5xYq0MDVp+CtR30aIuMR1ZyILau8tQX+nKlLBVs=; b=rdos8yPXIMrhlFdtHHqSgNB6MnJVc14FnUHWdKKcH7T2LnZzx4zIjuq8jeeb+UBbhX nO79bFsaZ5BnEs8/UCevxnkDtk+GoHO/oPwXA+Asi196X2Wi51BWeoJ/vp9S5R9ThTcb /D6VAARryhGjfrH54rWpF+nIKYUkJVUf58h3oDjbVk/my6hrhFSYncB1VUyphIS09sGn EilcIJnnQKVx1p1EwVo0SQnyKdu1pSDJJ1B6neJ9JSXVx8Xf5MWFVBa9u08zNPQ9ZAxt DPkuWRvVi8je/OgG6sMYxnwJJRJEjSFcfq4A+YhI7gUuN+x+TA9biaxPGrHjgSmjytne 8hjw== X-Gm-Message-State: AOJu0YyqyNyq/wqh5x+cklqt3px+/wRP7NAew+2xc3X3Bg1VytnxZ9VG k5espFFM1JG7x3rof25YYbaenCaOAN4v50+aPuJWhuunMiZIfBwoSQ/LHUm2XkiwySHNYwEkjfd nBveJi2TMHlxpvZvgVNQ6v7iI7SI= X-Google-Smtp-Source: AGHT+IFcDLCd95uHzMP4d6bwByc4EUhtLHYLIrsHXVvTwYVhSdZcsFTConOf6VwBaUX10totnb69jw4vFGcxzinohgw= X-Received: by 2002:a05:651c:c99:b0:2cd:9f94:f93a with SMTP id bz25-20020a05651c0c9900b002cd9f94f93amr1091834ljb.43.1706695092429; Wed, 31 Jan 2024 01:58:12 -0800 (PST) MIME-Version: 1.0 References: <8620df11-96e4-4ca3-8f3c-33a479260961@joeconway.com> <4162f7f7-6fd6-4720-98e2-89f80e3de2ed@joeconway.com> In-Reply-To: From: Junwang Zhao Date: Wed, 31 Jan 2024 17:58:00 +0800 Message-ID: Subject: Re: Emitting JSON to file using COPY TO To: vignesh C Cc: jian he , Masahiko Sawada , Joe Conway , Daniel Verite , Andrew Dunstan , Davin Shearer , PostgreSQL-development , Sutou Kouhei Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Vignesh, On Wed, Jan 31, 2024 at 5:50=E2=80=AFPM vignesh C wro= te: > > On Sat, 27 Jan 2024 at 11:25, Junwang Zhao wrote: > > > > Hi hackers, > > > > Kou-san(CCed) has been working on *Make COPY format extendable[1]*, so > > I think making *copy to json* based on that work might be the right dir= ection. > > > > I write an extension for that purpose, and here is the patch set togeth= er > > with Kou-san's *extendable copy format* implementation: > > > > 0001-0009 is the implementation of extendable copy format > > 00010 is the pg_copy_json extension > > > > I also created a PR[2] if anybody likes the github review style. > > > > The *extendable copy format* feature is still being developed, I post t= his > > email in case the patch set in this thread is committed without knowing > > the *extendable copy format* feature. > > > > I'd like to hear your opinions. > > CFBot shows that one of the test is failing as in [1]: > [05:46:41.678] /bin/sh: 1: cannot open > /tmp/cirrus-ci-build/contrib/pg_copy_json/sql/test_copy_format.sql: No > such file > [05:46:41.678] diff: > /tmp/cirrus-ci-build/contrib/pg_copy_json/expected/test_copy_format.out: > No such file or directory > [05:46:41.678] diff: > /tmp/cirrus-ci-build/contrib/pg_copy_json/results/test_copy_format.out: > No such file or directory > [05:46:41.678] # diff command failed with status 512: diff > "/tmp/cirrus-ci-build/contrib/pg_copy_json/expected/test_copy_format.out" > "/tmp/cirrus-ci-build/contrib/pg_copy_json/results/test_copy_format.out" > > "/tmp/cirrus-ci-build/contrib/pg_copy_json/results/test_copy_format.out= .diff" > [05:46:41.678] Bail out!make[2]: *** [../../src/makefiles/pgxs.mk:454: > check] Error 2 > [05:46:41.679] make[1]: *** [Makefile:96: check-pg_copy_json-recurse] Err= or 2 > [05:46:41.679] make: *** [GNUmakefile:71: check-world-contrib-recurse] Er= ror 2 > > Please post an updated version for the same. Thanks for the reminder, the patch set I posted is not for commit but for further discussion. I will post more information about the *extendable copy* feature when it's about to be committed. > > [1] - https://cirrus-ci.com/task/5322439115145216 > > Regards, > Vignesh --=20 Regards Junwang Zhao