Re: plpgsql variable assignment not supporting distinct anymore

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: easteregg@verfriemelt.org, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-01-22T18:59:50Z
Lists: pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> pá 22. 1. 2021 v 14:41 odesílatel <easteregg@verfriemelt.org> napsal:
>> ERROR:  syntax error at or near "DISTINCT"
>> LINE 8:     _test := DISTINCT a FROM ( VALUES ( (true), ( true ) ) )...

> Using DISTINCT is not a good solution.

Yeah.  It wouldn't be as painful to support this in the grammar
as it would be for UNION et al, so maybe we should just do it.
But I still find this to be mighty ugly plpgsql code.

			regards, tom lane



Commits

  1. Re-allow DISTINCT in pl/pgsql expressions.