Re: ECPG bug: "unterminated quoted identifier"

From: 1250kv <1250kv(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: ECPG bug: "unterminated quoted identifier"
Date: 2020-10-20 18:18:04
Message-ID: CA+4qtLd4K09yFA3S5ktaDDr0VQAVuXQpzvhbFufhGOisny+d7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

When I assign the value "aaa\"bbb" to the non-host variable foo and then
assign the value of foo to the host-variable bar there no error:

int main()
{
char *foo = "aaa\"bbb";
printf("%s\n", foo);

EXEC SQL char *bar = foo;
printf("%s\n", bar);

return 0;
}

Result:
aaa"bbb
aaa"bbb

On Tue, Oct 20, 2020 at 8:23 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> 1250kv <1250kv(at)gmail(dot)com> writes:
> > void main()
> > {
> > char *foo = "aaa\"bbb";
> > EXEC SQL char *bar = "aaa\"bbb";
> > }
>
> > ecpg sample.pgc -o 1.c
> > sample .pgc:10: ERROR: unterminated quoted identifier
>
> I don't really see a bug there. While I'm not an ecpg expert by
> any means, I'd expect the EXEC SQL section to parse quoted strings
> according to SQL rules not C rules. And under SQL, that's not
> what you do to write a valid quoted identifier.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-10-20 20:10:10 Re: ECPG bug: "unterminated quoted identifier"
Previous Message 1250kv 2020-10-20 18:05:18 Re: ECPG bug: "unterminated quoted identifier"