Skip to content

Commit c0d9796

Browse files
committed
Fix typo and attempt default fix.
1 parent a7b06f2 commit c0d9796

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/backend/catalog/heap.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.81 1999/05/19 16:46:10 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.82 1999/05/21 18:31:04 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -47,6 +47,7 @@
4747
#include "optimizer/tlist.h"
4848
#include "parser/parse_expr.h"
4949
#include "parser/parse_node.h"
50+
#include "parser/parse_target.h"
5051
#include "parser/parse_type.h"
5152
#include "parser/parse_coerce.h"
5253
#include "rewrite/rewriteRemove.h"
@@ -1545,11 +1546,11 @@ StoreAttrDefault(Relation rel, AttrDefault *attrdef)
15451546
if (atp->atttypid == BPCHAROID &&
15461547
(type == TEXTOID || type == BPCHAROID || type == UNKNOWNOID))
15471548
{
1548-
if (can_coerce_type(1, &(type), &(atp->atttypid)))
1549-
expr = coerce_type(NULL, (Node *)expr, type, atp->atttypid);
1550-
else
1551-
elog(ERROR, "DEFAULT clause const type '%s' can not be converted to char().",
1552-
typeidTypeName(type));
1549+
FuncCall *n = makeNode(FuncCall);
1550+
1551+
n->funcname = typeidTypeName(atp->atttypid);
1552+
n->args = lcons((Node *)expr, NIL);
1553+
expr = transformExpr(NULL, (Node *) n, EXPR_COLUMN_FIRST);
15531554
}
15541555
else if (IS_BINARY_COMPATIBLE(type, atp->atttypid))
15551556
; /* use without change */

src/backend/parser/gram.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.81 1999/05/21 15:47:13 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.82 1999/05/21 18:31:06 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -5365,8 +5365,8 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
53655365
for (pos = 1; n->val.val.str[pos]; pos++)
53665366
{
53675367
if (n->val.val.str[pos] == '|' ||
5368-
if (n->val.val.str[pos] == '{' ||
5369-
if (n->val.val.str[pos] == '}')
5368+
n->val.val.str[pos] == '{' ||
5369+
n->val.val.str[pos] == '}')
53705370
{
53715371
found_special = true;
53725372
break;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy