aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-12-01 12:44:16 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-12-01 12:44:16 -0500
commit65d9aedb1b0e2c160cee3ef6cddb284b092f542e (patch)
tree32e6a59edfcfdf81c2912b181a448bc714a04a2d /src/backend
parent1be6f9379287ecbbe6ab47636af7d41c7ae279ea (diff)
downloadpostgresql-65d9aedb1b0e2c160cee3ef6cddb284b092f542e.tar.gz
postgresql-65d9aedb1b0e2c160cee3ef6cddb284b092f542e.zip
Fix getTypeIOParam to support type record[].
Since record[] uses array_in, it needs to have its element type passed as typioparam. In HEAD and 9.1, this fix essentially reverts commit 9bc933b2125a5358722490acbc50889887bf7680, which was a hack that is no longer needed since domains don't set their typelem anymore. Before that, adjust the logic so that only domains are excluded from being treated like arrays, rather than assuming that only base types should be included. Add a regression test to demonstrate the need for this. Per report from Maxim Boguk. Back-patch to 8.4, where type record[] was added.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/utils/cache/lsyscache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index ceca0e3ede0..cb341b8db67 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -1890,10 +1890,9 @@ getTypeIOParam(HeapTuple typeTuple)
/*
* Array types get their typelem as parameter; everybody else gets their
- * own type OID as parameter. (As of 8.2, domains must get their own OID
- * even if their base type is an array.)
+ * own type OID as parameter.
*/
- if (typeStruct->typtype == TYPTYPE_BASE && OidIsValid(typeStruct->typelem))
+ if (OidIsValid(typeStruct->typelem))
return typeStruct->typelem;
else
return HeapTupleGetOid(typeTuple);