summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/preptlist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-03-17 00:11:05 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-03-17 00:11:05 +0000
commit0f4ff460c479e9c9bff90e8208f0a5272b9925df (patch)
treef22187ef35d7284cbc42f9255c369378d16ffe07 /src/backend/optimizer/prep/preptlist.c
parent51d7741db13332523708cd7ac75a8ca60c9d16a9 (diff)
downloadpostgresql-0f4ff460c479e9c9bff90e8208f0a5272b9925df.tar.gz
Fix up the remaining places where the expression node structure would lose
available information about the typmod of an expression; namely, Const, ArrayRef, ArrayExpr, and EXPR and ARRAY SubLinks. In the ArrayExpr and SubLink cases it wasn't really the data structure's fault, but exprTypmod() being lazy. This seems like a good idea in view of the expected increase in typmod usage from Teodor's work to allow user-defined types to have typmods. In particular this responds to the concerns we had about eliminating the special-purpose hack that exprTypmod() used to have for BPCHAR Consts. We can now tell whether or not such a Const has been cast to a specific length, and report or display properly if so. initdb forced due to changes in stored rules.
Diffstat (limited to 'src/backend/optimizer/prep/preptlist.c')
-rw-r--r--src/backend/optimizer/prep/preptlist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c
index 310b57392c..587e8f8918 100644
--- a/src/backend/optimizer/prep/preptlist.c
+++ b/src/backend/optimizer/prep/preptlist.c
@@ -16,7 +16,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/prep/preptlist.c,v 1.86 2007/02/19 07:03:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/prep/preptlist.c,v 1.87 2007/03/17 00:11:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -281,6 +281,7 @@ expand_targetlist(List *tlist, int command_type,
if (!att_tup->attisdropped)
{
new_expr = (Node *) makeConst(atttype,
+ -1,
att_tup->attlen,
(Datum) 0,
true, /* isnull */
@@ -296,6 +297,7 @@ expand_targetlist(List *tlist, int command_type,
{
/* Insert NULL for dropped column */
new_expr = (Node *) makeConst(INT4OID,
+ -1,
sizeof(int32),
(Datum) 0,
true, /* isnull */
@@ -315,6 +317,7 @@ expand_targetlist(List *tlist, int command_type,
{
/* Insert NULL for dropped column */
new_expr = (Node *) makeConst(INT4OID,
+ -1,
sizeof(int32),
(Datum) 0,
true, /* isnull */