Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0Gam-0000gj-Qe for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 07:01:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q0GZm-00021l-22 for pgsql-hackers@arkaria.postgresql.org; Sat, 20 May 2023 07:00:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0GZk-00021b-Pg for pgsql-hackers@lists.postgresql.org; Sat, 20 May 2023 07:00:25 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q0GZa-000sbp-Ss for pgsql-hackers@lists.postgresql.org; Sat, 20 May 2023 07:00:23 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E9FEE32009B1; Sat, 20 May 2023 03:00:09 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Sat, 20 May 2023 03:00:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1684566009; x=1684652409; bh=XO thvM0ucPcusPEL+yAzgEZ2v6ipMzt6wGG1lJiK330=; b=PiYd/2PdWFxr+P4KDx 6zm0KyquJoPDTIlJrsGdD9D4TstiwRh12WEdgcBCaLXANPyTXaLqI6+MdDTlRbhw f65ufgF6pPzaBBsxje3psnAThR32TZFLb1GK7Eg1Ar2jgYLIND3wZrBg6tMQ1of4 5dRmhmnVA6eNxgWRDH1RbOpqcpVCYbYoJupYeHpVAYAnMyRg0FD0tal3W8dUap5i cbr+10phl5hrI1HcgL/yQ2bs6E5O3MPDuHazKVOU9mN4/3/lM4ns2iPult/jn81p S84WWN8lKtIAmo5DvW1aXVyF2RjJRHAIOMO5O5LAGaAkrShSRPd629bSo83tdXYU 94Fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1684566009; x=1684652409; bh=XOthvM0ucPcus PEL+yAzgEZ2v6ipMzt6wGG1lJiK330=; b=zE9yhFH3wOMRUSK8uk+QIC+kJGTuJ J3i7mfVq+yL3VSftr7jCdSFVORBNIGW2aIIk66kkgnBCd4mnjpjqsCKlSN+wA4EV fJO/Y31uKe43b6B65H6IGxUTMSxzyTyZDzk6kskGX7FGVKAVtZmYc361o7E9S+2L rLahJPurJUxIi20a80pigoxx7lfu1A2od3dIKKVyGUzeGSSbUJkq2Kfw3qS7NZyk ytg87ydkiVamjc3UI/oLkGpslr2p0auzIu9vZ4jm/X6YH2xO8bMY1r5DcV/7H4cg zMunCOTJQ6uAGPDj528UX84k03WUfLLOr9otQTAn9WCb/z+kpOYdd02TA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeiiedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedflfho vghlucflrggtohgsshhonhdfuceojhhovghlsegtohhmphhilhgvrhdrohhrgheqnecugg ftrfgrthhtvghrnheptdeuudfftdefffejuddttefhvdetheejheejieetgfduieffffef gffggedvheefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepjhhovghlsegtohhmphhilhgvrhdrohhrgh X-ME-Proxy: Feedback-ID: ic6394509:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 85C2331A0063; Sat, 20 May 2023 03:00:08 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-431-g1d6a3ebb56-fm-20230511.001-g1d6a3ebb Mime-Version: 1.0 Message-Id: <0400a90b-ff40-4be5-8f90-6c205c9cd99b@app.fastmail.com> In-Reply-To: References: <748b7bfc-9f16-4bea-b7e1-4a59dc9354f5@app.fastmail.com> Date: Sat, 20 May 2023 08:59:46 +0200 From: "Joel Jacobson" To: "Andrew Dunstan" , pgsql-hackers@lists.postgresql.org Subject: Re: New COPY options: DELIMITER NONE and QUOTE NONE Content-Type: multipart/alternative; boundary=e2b1bf7b48074775abc3b1fb0988ee90 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --e2b1bf7b48074775abc3b1fb0988ee90 Content-Type: text/plain On Fri, May 19, 2023, at 19:03, Andrew Dunstan wrote: > I think you've been a bit too cute with the grammar changes, but as you say this is a POC. Thanks for feedback. The approach I took for the new grammar rules was inspired by previous commits, such as de7531a971b, which introduced support for 'FORCE QUOTE '*''. In that case, a new separate grammar rule was crafted. Not sure what you mean with it being "too cute", but maybe you think it's a bit verbose with another grammar rule and it would be better to integrate it into the existing one? Example: | DELIMITER opt_as (Sconst | NONE) { if ($3 == NONE) $$ = makeDefElem("delimiter", (Node *) makeString("\0"), @1); else $$ = makeDefElem("delimiter", (Node *) makeString($3), @1); } /Joel --e2b1bf7b48074775abc3b1fb0988ee90 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Fri, Ma= y 19, 2023, at 19:03, Andrew Dunstan wrote:
> I think y= ou've been a bit too cute with the grammar changes, but as you say this = is a POC.

Thanks for feedback.

The approach I took for the new grammar rules was inspi= red by previous commits,
such as de7531a971b, which introd= uced support for 'FORCE QUOTE '*''. In that
case, a new se= parate grammar rule was crafted.

Not sure w= hat you mean with it being "too cute", but maybe you think it's a bit
verbose with another grammar rule and it would be better to = integrate it into
the existing one?

Example:

| DELIMITER opt_as (Sconst = | NONE)
        {
          &nb= sp;     if ($3 =3D=3D NONE)
 &nbs= p;           &nbs= p;          $$ =3D makeDefE= lem("delimiter", (Node *) makeString("\0"), @1);
 &nb= sp;           &nb= sp;  else
       &= nbsp;           &= nbsp;    $$ =3D makeDefElem("delimiter", (Node *) makeStr= ing($3), @1);
        }=

/Joel

--e2b1bf7b48074775abc3b1fb0988ee90--