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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Re-allow DISTINCT in pl/pgsql expressions.
Date: 2021-01-22 21:26:29
Message-ID: E1l33wr-0005sJ-9n@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Re-allow DISTINCT in pl/pgsql expressions.

I'd omitted this from the grammar in commit c9d529848, figuring that
it wasn't worth supporting. However we already have one complaint,
so it seems that judgment was wrong. It doesn't require a huge
amount of code, so add it back. (I'm still drawing the line at
UNION/INTERSECT/EXCEPT though: those'd require an unreasonable
amount of grammar refactoring, and the single-result-row restriction
makes them near useless anyway.)

Also rethink the documentation: this behavior is a property of
all pl/pgsql expressions, not just assignments.

Discussion: https://postgr.es/m/20210122134106.e94c5cd7@mail.verfriemelt.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7cd9765f9bd3397b8d4d0f507021ef848b6d48d2

Modified Files
--------------
doc/src/sgml/plpgsql.sgml | 32 ++++++++++++++++++--------------
src/backend/parser/analyze.c | 29 ++++++++++++++++++++++++-----
src/backend/parser/gram.y | 44 ++++++++++++++++++++++++++++----------------
3 files changed, 70 insertions(+), 35 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-01-22 21:52:48 pgsql: Avoid redundantly prefixing PQerrorMessage for a connection fail
Previous Message Tom Lane 2021-01-22 16:30:48 pgsql: Doc: remove misleading claim in documentation of PQreset().