Re: distinct on extract returns composite type

Tom Lane <[email protected]> Mon, 30 Sep 2019 09:48:16 -0400
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <[email protected]>
Mariel Cherkassky <[email protected]> writes:
> In my query I wrapped the columns with distinct : distinct (extract year...
> , extract quarter..).
> In your query you didnt wrap the columns with distinct but you just
> mentioned it. I guess this is the difference, thanks !

Yeah.  DISTINCT does not have an argument, it's just a keyword you
can stick in after SELECT.  So what you had as the select's targetlist
was (expr,expr), which is read as an implicit row constructor, that
is the same as ROW(expr,expr).  One of many arguably not-well-designed
things about SQL syntax :-(

			regards, tom lane