mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is now
SELECT DISTINCT ON (expr [, expr ...]) targetlist ... and there is a check to make sure that the user didn't specify an ORDER BY that's incompatible with the DISTINCT operation. Reimplement nodeUnique and nodeGroup to use the proper datatype-specific equality function for each column being compared --- they used to do bitwise comparisons or convert the data to text strings and strcmp(). (To add insult to injury, they'd look up the conversion functions once for each tuple...) Parse/plan representation of DISTINCT is now a list of SortClause nodes. initdb forced by querytree change...
This commit is contained in:
@ -34,12 +34,12 @@ select * from pg_database where nonesuch = pg_database.datname;
|
||||
select * from pg_database where pg_database.datname = nonesuch;
|
||||
|
||||
|
||||
-- bad select distinct on syntax, distinct attribute missing
|
||||
select distinct on foobar from pg_database;
|
||||
-- bad select distinct on syntax, distinct attribute missing
|
||||
select distinct on (foobar) from pg_database;
|
||||
|
||||
|
||||
-- bad select distinct on syntax, distinct attribute not in target list
|
||||
select distinct on foobar * from pg_database;
|
||||
select distinct on (foobar) * from pg_database;
|
||||
|
||||
|
||||
--
|
||||
|
Reference in New Issue
Block a user