diff options
| author | Bruce Momjian <bruce@momjian.us> | 2000-08-29 04:20:47 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2000-08-29 04:20:47 +0000 |
| commit | d4f626507ca56bf3e1a8adeea7f158535ddb0220 (patch) | |
| tree | 86f7e998ee995a2393c4e2b74f6573a57abf47c0 /src/test/regress/sql/foreign_key.sql | |
| parent | c51041f4ba52d722c336a1ac28ebe6be61df88bc (diff) | |
| download | postgresql-d4f626507ca56bf3e1a8adeea7f158535ddb0220.tar.gz | |
This is mostly the same as an earlier patch I
didn't hear anything about, but which would
have broken with the function manager changes
anyway.
Well, this patch checks that a unique constraint
of some form (unique or pk) is on the referenced
columns of an FK constraint and that the columns
in the referencing table exist at creation time.
The former is to move closer to SQL compatibility
and the latter is in answer to a bug report.
I also added a basic check of this functionality
to the alter table and foreign key regression
tests.
Stephan Szabo
sszabo@bigpanda.com
Diffstat (limited to 'src/test/regress/sql/foreign_key.sql')
| -rw-r--r-- | src/test/regress/sql/foreign_key.sql | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/regress/sql/foreign_key.sql b/src/test/regress/sql/foreign_key.sql index d08f2ce2d0..ac29e50579 100644 --- a/src/test/regress/sql/foreign_key.sql +++ b/src/test/regress/sql/foreign_key.sql @@ -411,4 +411,10 @@ SELECT * from FKTABLE; DROP TABLE FKTABLE; DROP TABLE PKTABLE; +CREATE TABLE PKTABLE (ptest1 int PRIMARY KEY); +CREATE TABLE FKTABLE_FAIL1 ( ftest1 int, CONSTRAINT fkfail1 FOREIGN KEY (ftest2) REFERENCES PKTABLE); +CREATE TABLE FKTABLE_FAIL2 ( ftest1 int, CONSTRAINT fkfail1 FOREIGN KEY (ftest1) REFERENCES PKTABLE(ptest2)); +DROP TABLE FKTABLE_FAIL1; +DROP TABLE FKTABLE_FAIL2; +DROP TABLE PKTABLE; |
