Use the parser macro IS_BINARY_COMPATIBLE() to allow more success
in type checking for DEFAULT contraint clauses. Could do more type coersion later...
This commit is contained in:
parent
91162057ae
commit
15f82836bf
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.56 1998/08/06 05:12:19 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.57 1998/08/17 16:03:31 thomas Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* heap_create() - Create an uncataloged heap relation
|
* heap_create() - Create an uncataloged heap relation
|
||||||
@ -47,6 +47,7 @@
|
|||||||
#include "parser/parse_expr.h"
|
#include "parser/parse_expr.h"
|
||||||
#include "parser/parse_node.h"
|
#include "parser/parse_node.h"
|
||||||
#include "parser/parse_type.h"
|
#include "parser/parse_type.h"
|
||||||
|
#include "parser/parse_coerce.h"
|
||||||
#include "rewrite/rewriteRemove.h"
|
#include "rewrite/rewriteRemove.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
#include "storage/lmgr.h"
|
#include "storage/lmgr.h"
|
||||||
@ -1519,7 +1520,8 @@ start:;
|
|||||||
goto start;
|
goto start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (exprType(expr) != atp->atttypid)
|
else if ((exprType(expr) != atp->atttypid)
|
||||||
|
&& !IS_BINARY_COMPATIBLE(exprType(expr), atp->atttypid))
|
||||||
elog(ERROR, "DEFAULT: type mismatched");
|
elog(ERROR, "DEFAULT: type mismatched");
|
||||||
|
|
||||||
adbin = nodeToString(expr);
|
adbin = nodeToString(expr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user