aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-06 23:00:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-06 23:00:50 +0000
commit2d4db3675fa7a2f4831b755bc98242421901042f (patch)
tree5961b42325091b789d0f82073812de57323fa4b1 /src/backend/executor/functions.c
parent7dab4f75ca60f1c04ed9e7ff9d4ca8d71e572b29 (diff)
downloadpostgresql-2d4db3675fa7a2f4831b755bc98242421901042f.tar.gz
postgresql-2d4db3675fa7a2f4831b755bc98242421901042f.zip
Fix up text concatenation so that it accepts all the reasonable cases that
were accepted by prior Postgres releases. This takes care of the loose end left by the preceding patch to downgrade implicit casts-to-text. To avoid breaking desirable behavior for array concatenation, introduce a new polymorphic pseudo-type "anynonarray" --- the added concatenation operators are actually text || anynonarray and anynonarray || text.
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r--src/backend/executor/functions.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 9ad13916123..8beea3f5396 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.116 2007/04/27 22:05:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.117 2007/06/06 23:00:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -849,9 +849,9 @@ ShutdownSQLFunction(Datum arg)
* to be sure that the user is returning the type he claims.
*
* For a polymorphic function the passed rettype must be the actual resolved
- * output type of the function; we should never see ANYARRAY, ANYENUM or
- * ANYELEMENT as rettype. (This means we can't check the type during function
- * definition of a polymorphic function.)
+ * output type of the function; we should never see a polymorphic pseudotype
+ * such as ANYELEMENT as rettype. (This means we can't check the type during
+ * function definition of a polymorphic function.)
*
* This function returns true if the sql function returns the entire tuple
* result of its final SELECT, and false otherwise. Note that because we
@@ -874,6 +874,8 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
char fn_typtype;
Oid restype;
+ AssertArg(!IsPolymorphicType(rettype));
+
if (junkFilter)
*junkFilter = NULL; /* default result */