diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-03 23:55:40 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-03 23:55:40 +0000 |
| commit | eabc714a916b772650c97b065ef27767dc5942e4 (patch) | |
| tree | 9271817f0a846e303ae8d32338b1d58a5c2754d5 /src/test/regress/output/constraints.source | |
| parent | f29ccc827006d13be0f4bf0255b06f3c4e921709 (diff) | |
| download | postgresql-eabc714a916b772650c97b065ef27767dc5942e4.tar.gz | |
Reimplement parsing and storage of default expressions and constraint
expressions in CREATE TABLE. There is no longer an emasculated expression
syntax for these things; it's full a_expr for constraints, and b_expr
for defaults (unfortunately the fact that NOT NULL is a part of the
column constraint syntax causes a shift/reduce conflict if you try a_expr.
Oh well --- at least parenthesized boolean expressions work now). Also,
stored expression for a column default is not pre-coerced to the column
type; we rely on transformInsertStatement to do that when the default is
actually used. This means "f1 datetime default 'now'" behaves the way
people usually expect it to.
BTW, all the support code is now there to implement ALTER TABLE ADD
CONSTRAINT and ALTER TABLE ADD COLUMN with a default value. I didn't
actually teach ALTER TABLE to call it, but it wouldn't be much work.
Diffstat (limited to 'src/test/regress/output/constraints.source')
| -rw-r--r-- | src/test/regress/output/constraints.source | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/regress/output/constraints.source b/src/test/regress/output/constraints.source index edacd7d93f..6b905e7f42 100644 --- a/src/test/regress/output/constraints.source +++ b/src/test/regress/output/constraints.source @@ -34,7 +34,9 @@ four| i1|i2 QUERY: CREATE TABLE error_tbl (i int DEFAULT (100, )); ERROR: parser: parse error at or near "," QUERY: CREATE TABLE error_tbl (b1 bool DEFAULT 1 < 2); -ERROR: boolean expressions not supported in DEFAULT +ERROR: parser: parse error at or near "<" +QUERY: CREATE TABLE error_tbl (b1 bool DEFAULT (1 < 2)); +QUERY: DROP TABLE error_tbl; QUERY: CREATE TABLE CHECK_TBL (x int, CONSTRAINT CHECK_CON CHECK (x > 3)); QUERY: INSERT INTO CHECK_TBL VALUES (5); |
