pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 1250kv <1250kv@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: ECPG bug: "unterminated quoted identifier"
Date: Tue, 20 Oct 2020 21:12:44 -0400
Message-ID: <694247.1603242764@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+4qtLdi58jvzOacFTWBySF2gQcuC6JOMhh+cX0K=K53sq0aFw@mail.gmail.com>
References: <CA+4qtLct1L=gUordX4c_AdctJ+vZBsebYYLBk18LX8dLHthktg@mail.gmail.com>
	<652858.1603214598@sss.pgh.pa.us>
	<CA+4qtLd4K09yFA3S5ktaDDr0VQAVuXQpzvhbFufhGOisny+d7w@mail.gmail.com>
	<674892.1603224610@sss.pgh.pa.us>
	<CA+4qtLdi58jvzOacFTWBySF2gQcuC6JOMhh+cX0K=K53sq0aFw@mail.gmail.com>

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





view thread (9+ messages)  latest in thread

Message-ID: <694247.1603242764@sss.pgh.pa.us>
Permalink:  ../694247.1603242764@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/694247.1603242764@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, 1250kv@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: ECPG bug: "unterminated quoted identifier"
  In-Reply-To: <694247.1603242764@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox