Re: BUG #18195: PL/pgSQL: invalid syntax allowed in SELECT INTO statement - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: BUG #18195: PL/pgSQL: invalid syntax allowed in SELECT INTO statement
Date
Msg-id CAFj8pRAQCb+WsPuh9EYgY0F-p=o+7b1oA0Uubi4L=darg-SbZQ@mail.gmail.com
Whole thread Raw
In response to RE: BUG #18195: PL/pgSQL: invalid syntax allowed in SELECT INTO statement  ("Pavel Kulakov" <paul.kulakov@systematica.ru>)
List pgsql-bugs


st 15. 11. 2023 v 8:47 odesílatel Pavel Kulakov <paul.kulakov@systematica.ru> napsal:
This also permits the following syntax in PL/pgSQL:

do $sql$
declare _s text;
begin
   _s = '1' somegarbage;
end;
$sql$;

I understand why it works. But it looks really strange.

yes, it is strange, but PL/pgSQL is a translator from PL/pgSQL to SQL, and '1 xxx' is the correct expression in SQL. Probably today, where PL/pgSQL assign statements are supported in SQL parser the better design can be implemented. But probably it should still be hard for SELECT INTO.

pgsql-bugs by date:

Previous
From: "Pavel Kulakov"
Date:
Subject: RE: BUG #18195: PL/pgSQL: invalid syntax allowed in SELECT INTO statement
Next
From: PG Bug reporting form
Date:
Subject: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows