From c0d979614e33a52498dbac17a09b332e79d312fe Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 21 May 1999 18:31:06 +0000 Subject: [PATCH] Fix typo and attempt default fix. --- src/backend/catalog/heap.c | 13 +++++++------ src/backend/parser/gram.y | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 32eb247077..564f185b23 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.81 1999/05/19 16:46:10 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.82 1999/05/21 18:31:04 momjian Exp $ * * * INTERFACE ROUTINES @@ -47,6 +47,7 @@ #include "optimizer/tlist.h" #include "parser/parse_expr.h" #include "parser/parse_node.h" +#include "parser/parse_target.h" #include "parser/parse_type.h" #include "parser/parse_coerce.h" #include "rewrite/rewriteRemove.h" @@ -1545,11 +1546,11 @@ start: if (atp->atttypid == BPCHAROID && (type == TEXTOID || type == BPCHAROID || type == UNKNOWNOID)) { - if (can_coerce_type(1, &(type), &(atp->atttypid))) - expr = coerce_type(NULL, (Node *)expr, type, atp->atttypid); - else - elog(ERROR, "DEFAULT clause const type '%s' can not be converted to char().", - typeidTypeName(type)); + FuncCall *n = makeNode(FuncCall); + + n->funcname = typeidTypeName(atp->atttypid); + n->args = lcons((Node *)expr, NIL); + expr = transformExpr(NULL, (Node *) n, EXPR_COLUMN_FIRST); } else if (IS_BINARY_COMPATIBLE(type, atp->atttypid)) ; /* use without change */ diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index bb2a586382..a0f9e8a43b 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.81 1999/05/21 15:47:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.82 1999/05/21 18:31:06 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -5365,8 +5365,8 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr) for (pos = 1; n->val.val.str[pos]; pos++) { if (n->val.val.str[pos] == '|' || - if (n->val.val.str[pos] == '{' || - if (n->val.val.str[pos] == '}') + n->val.val.str[pos] == '{' || + n->val.val.str[pos] == '}') { found_special = true; break; -- 2.11.0