1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Fix for DEFAULT ''.

This commit is contained in:
Bruce Momjian
1999-05-22 04:12:29 +00:00
parent 9710995fc9
commit a8d2820e6d
8 changed files with 40 additions and 45 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.83 1999/05/21 18:33:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.84 1999/05/22 04:12:24 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -1538,26 +1538,11 @@ start:
if (type != atp->atttypid)
{
/*
* Though these types are binary compatible, bpchar has a fixed
* length on the disk, requiring non-bpchar types to be padded
* before storage in the default table. bjm 1999/05/18
*/
if (1==0 && atp->atttypid == BPCHAROID &&
(type == TEXTOID || type == BPCHAROID || type == UNKNOWNOID))
{
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))
if (IS_BINARY_COMPATIBLE(type, atp->atttypid))
; /* use without change */
else if (can_coerce_type(1, &(type), &(atp->atttypid)))
expr = coerce_type(NULL, (Node *)expr, type, atp->atttypid);
expr = coerce_type(NULL, (Node *)expr, type, atp->atttypid,
atp->atttypmod);
else if (IsA(expr, Const))
{
if (*cast != 0)