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 1kV2gN-0004jD-IX for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Oct 2020 01:12:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kV2gL-0003rO-E6 for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Oct 2020 01:12:49 +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 1kV2gL-0003rH-7x for pgsql-bugs@lists.postgresql.org; Wed, 21 Oct 2020 01:12:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kV2gJ-0006yC-0a for pgsql-bugs@lists.postgresql.org; Wed, 21 Oct 2020 01:12:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 09L1CirC694248; Tue, 20 Oct 2020 21:12:44 -0400 From: Tom Lane To: 1250kv <1250kv@gmail.com> cc: PostgreSQL mailing lists Subject: Re: ECPG bug: "unterminated quoted identifier" In-reply-to: References: <652858.1603214598@sss.pgh.pa.us> <674892.1603224610@sss.pgh.pa.us> Comments: In-reply-to 1250kv <1250kv@gmail.com> message dated "Wed, 21 Oct 2020 01:51:09 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <694246.1603242764.1@sss.pgh.pa.us> Date: Tue, 20 Oct 2020 21:12:44 -0400 Message-ID: <694247.1603242764@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 1250kv <1250kv@gmail.com> writes: > I have come across cases in which there is a need to use nested double > quotes inside C string literal. > EXEC SQL EXECUTE IMMEDIATE "DO $$\n\ > BEGIN\n\ > :i := embeddedc.\"My_Func\"(:i);\n\ > END\n\ > $$"; I'd be interested to understand why you feel the need to write that, and not just EXEC SQL DO $$ BEGIN :i := embeddedc."My_Func"(:i); END $$; AFAICS, EXECUTE IMMEDIATE with a constant string isn't really useful for anything. (Note that if you mean those :i's as references to your ECPG variable, I don't think that works in either syntax, since it's inside a literal.) regards, tom lane