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 1nvfOl-0004GX-NO for pgsql-hackers@arkaria.postgresql.org; Mon, 30 May 2022 13:25:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nvfOk-00086X-57 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 May 2022 13:25:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvfOj-00086O-S4 for pgsql-hackers@lists.postgresql.org; Mon, 30 May 2022 13:25:29 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvfOg-0004r4-Js; Mon, 30 May 2022 13:25:28 +0000 Received: from feivel.credativ.lan ([178.200.216.193]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MpDRv-1nSiFT1I6B-00qlC8; Mon, 30 May 2022 15:25:20 +0200 Received: by feivel.credativ.lan (Postfix, from userid 1000) id 655D9E00D8; Mon, 30 May 2022 15:25:16 +0200 (CEST) Date: Mon, 30 May 2022 15:25:16 +0200 From: Michael Meskes To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, Andrew Dunstan , Michael Meskes Subject: Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word Message-ID: Mail-Followup-To: Tom Lane , pgsql-hackers@lists.postgresql.org, Andrew Dunstan , Michael Meskes References: <3661437.1653855582@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3661437.1653855582@sss.pgh.pa.us> X-Provags-ID: V03:K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Nt+38= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > I looked briefly at whether we could improve that situation. > Two of the four uses of ECPGColLabelCommon in ecpg.trailer can be > converted to the more general ECPGColLabel without difficulty, > but trying to change either of the uses in var_type results in > literally thousands of shift/reduce and reduce/reduce conflicts. > This seems to be because what follows ecpgstart can be either a general > SQL statement or an ECPGVarDeclaration (beginning with var_type), > and bison isn't smart enough to disambiguate. I have a feeling that > this situation could be improved with enough elbow grease, because > plpgsql manages to solve a closely-related problem in allowing its > assignment statements to coexist with general SQL statements. But > I don't have the interest to tackle it personally, and anyway any > fix would probably be more invasive than we want to put in post-beta. Right, the reason for all this is that the part after the "exec sql" could be either language, SQL or C. It has been like this for all those years. I do not claim that the solution we have is the best, it's only the best I could come up with when I implemented it. If anyone has a better way, please be my guest. > I also wondered briefly about just changing the affected test cases, > reasoning that breaking some ECPG applications that use "string" is > less bad than breaking everybody else that uses "string". But type > "string" is apparently a standard ECPG and/or INFORMIX thing, so we > probably can't get away with that. IIRC STRING is a normal datatype for INFORMIX and thus is implemented in ECPG for its compatibility. > Hence, I propose the attached, which fixes the easily-fixable > ECPGColLabelCommon uses and adds a hard-wired special case for > STRING to handle the var_type usage. I'm fine with this approach. Thanks Tom. Michael -- Michael Meskes Michael at Fam-Meskes dot De Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org