Nondeterministic collations and the value returned by GROUP BY x - Mailing list pgsql-hackers

From Jim Finnerty
Subject Nondeterministic collations and the value returned by GROUP BY x
Date
Msg-id 1615843912441-0.post@n3.nabble.com
Whole thread Raw
Responses Re: Nondeterministic collations and the value returned by GROUP BY x  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
PostgreSQL 12 and onward supports nondeterministic collations.  For "GROUP
BY x",  which value of 'x' will PostgreSQL return in this case?  The first
value of x?

The SQL standard (section 8.2) states that the specific value returned is
implementation-defined, but requires that the value must be one of the
specific values in the set of values that compare equally:

d) Depending on the collation, two strings may compare as equal even if they
are of different lengths or contain different sequences of characters. When
any of the operations MAX, MIN, and DISTINCT reference a grouping column,
and the UNION, EXCEPT, and INTERSECT operators refer to character strings,
*the specific value selected by these operations from a set of such equal
values is implementation- dependent*.




-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: New IndexAM API controlling index vacuum strategies
Next
From: Stephen Frost
Date:
Subject: Re: Enhance traceability of wal_level changes for backup management