1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Allow GROUP BY, ORDER BY, DISTINCT targets to be unknown literals,

silently resolving them to type TEXT.  This is comparable to what we
do when faced with UNKNOWN in CASE, UNION, and other contexts.  It gets
rid of this and related annoyances:
	select distinct f1, '' from int4_tbl;
	ERROR:  Unable to identify an ordering operator '<' for type unknown
This was discussed many moons ago, but no one got round to fixing it.
This commit is contained in:
Tom Lane
2003-06-16 02:03:38 +00:00
parent cb02610e50
commit a499725469
6 changed files with 105 additions and 39 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.145 2003/06/15 22:51:45 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.146 2003/06/16 02:03:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -583,7 +583,7 @@ create_unique_plan(Query *root, UniquePath *best_path)
{
List *sortList;
sortList = addAllTargetsToSortList(NIL, my_tlist);
sortList = addAllTargetsToSortList(NULL, NIL, my_tlist, false);
plan = (Plan *) make_sort_from_sortclauses(root, my_tlist,
subplan, sortList);
plan = (Plan *) make_unique(my_tlist, plan, sortList);