st 15. 11. 2023 v 8:47 odesílatel Pavel Kulakov <paul(dot)kulakov(at)systematica(dot)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.