summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2009-10-06 00:55:35 +0000
committerTom Lane2009-10-06 00:55:35 +0000
commit8e3384e35df25479371fb196ec49e58c7940a5a6 (patch)
treef9a8b5a218e0491848f9244b50974440e1af4471 /src/include
parent83a673808dc3a47363eae6388bea8571e2bc07a3 (diff)
Change CREATE TABLE so that column default expressions coming from different
inheritance parent tables are compared using equal(), instead of doing strcmp() on the nodeToString representation. The old implementation was always a tad cheesy, and it finally fails completely as of 8.4, now that the node tree might contain syntax location information. equal() knows it's supposed to ignore those fields, but strcmp() hardly can. Per recent report from Scott Ribe.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/nodes/parsenodes.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 7793f66f20f..f27d9a26bda 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.395 2009/06/18 01:27:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.395.2.1 2009/10/06 00:55:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -443,10 +443,9 @@ typedef struct RangeFunction
*
* If the column has a default value, we may have the value expression
* in either "raw" form (an untransformed parse tree) or "cooked" form
- * (the nodeToString representation of an executable expression tree),
- * depending on how this ColumnDef node was created (by parsing, or by
- * inheritance from an existing relation). We should never have both
- * in the same node!
+ * (a post-parse-analysis, executable expression tree), depending on
+ * how this ColumnDef node was created (by parsing, or by inheritance
+ * from an existing relation). We should never have both in the same node!
*
* The constraints list may contain a CONSTR_DEFAULT item in a raw
* parsetree produced by gram.y, but transformCreateStmt will remove
@@ -462,7 +461,7 @@ typedef struct ColumnDef
bool is_local; /* column has local (non-inherited) def'n */
bool is_not_null; /* NOT NULL constraint specified? */
Node *raw_default; /* default value (untransformed parse tree) */
- char *cooked_default; /* nodeToString representation */
+ Node *cooked_default; /* default value (transformed expr tree) */
List *constraints; /* other constraints on column */
} ColumnDef;