diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-16 02:03:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-16 02:03:38 +0000 |
commit | a4997254693057d4587d74222881b8e03580da2c (patch) | |
tree | c022e641ec691ce3f108b28e0720444da6ed3eef /src/backend/parser/analyze.c | |
parent | cb02610e503957d7ed9b4375537fb6275c16f1fa (diff) |
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.
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r-- | src/backend/parser/analyze.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 95b209e4acb..3f4cb22cdf7 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.274 2003/06/15 16:42:07 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.275 2003/06/16 02:03:37 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1793,7 +1793,8 @@ transformSelectStmt(ParseState *pstate, SelectStmt *stmt) */ qry->sortClause = transformSortClause(pstate, stmt->sortClause, - qry->targetList); + qry->targetList, + true /* fix unknowns */); qry->groupClause = transformGroupClause(pstate, stmt->groupClause, @@ -2002,7 +2003,8 @@ transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt) qry->sortClause = transformSortClause(pstate, sortClause, - qry->targetList); + qry->targetList, + false /* no unknowns expected */); pstate->p_namespace = sv_namespace; pstate->p_rtable = sv_rtable; |