Re: ECPG bug: "unterminated quoted identifier"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 1250kv <1250kv(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: ECPG bug: "unterminated quoted identifier"
Date: 2020-10-21 01:12:44
Message-ID: 694247.1603242764@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

1250kv <1250kv(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2020-10-21 01:17:25 Re: Incorrect rounding of double values at max precision
Previous Message Andres Freund 2020-10-21 00:45:02 Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue