aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-04-28 00:49:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-04-28 00:49:13 +0000
commit25dfba3954fc1792ac14f54eb9635758d32f1323 (patch)
treebeb3b7429fab83706d6ad1a7342314e3e57a9a6c /src/backend/parser/parse_expr.c
parent7677fe0aa66f7827813475c91e0151e7bc09486a (diff)
downloadpostgresql-25dfba3954fc1792ac14f54eb9635758d32f1323.tar.gz
postgresql-25dfba3954fc1792ac14f54eb9635758d32f1323.zip
Make ruleutils.c use format_type for printing typenames. Minor tweaks
in quoting rules and recognition of implicit type coercions.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r--src/backend/parser/parse_expr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index a3525487485..100bf9a7b49 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.115 2002/04/16 23:08:11 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.116 2002/04/28 00:49:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1062,8 +1062,8 @@ exprIsLengthCoercion(Node *expr, int32 *coercedTypmod)
}
/*
- * Furthermore, the name of the function must be the same as the
- * argument/result type's name.
+ * Furthermore, the name and namespace of the function must be the same
+ * as its result type's name/namespace (cf. find_coercion_function).
*/
typeTuple = SearchSysCache(TYPEOID,
ObjectIdGetDatum(procStruct->prorettype),
@@ -1072,9 +1072,9 @@ exprIsLengthCoercion(Node *expr, int32 *coercedTypmod)
elog(ERROR, "cache lookup for type %u failed",
procStruct->prorettype);
typeStruct = (Form_pg_type) GETSTRUCT(typeTuple);
- if (strncmp(NameStr(procStruct->proname),
- NameStr(typeStruct->typname),
- NAMEDATALEN) != 0)
+ if (strcmp(NameStr(procStruct->proname),
+ NameStr(typeStruct->typname)) != 0 ||
+ procStruct->pronamespace != typeStruct->typnamespace)
{
ReleaseSysCache(procTuple);
ReleaseSysCache(typeTuple);