-
Notifications
You must be signed in to change notification settings - Fork 6
yb_pg_foreign_key bug #270
Comments
Added new task to add the support for foreign key validation in pg session: |
(gdb) bt |
tablecmds.c:8795
(gdb) p indexStruct->indnkeyatts as we can see the table creation failed because the ddl "CREATE TABLE FKTABLE_FAIL3 (ftest1 int REFERENCES pktable(ptest1))" only reference to one of the two unique constraint columns, i.e., ptest1, which is not guaranteed to be unique. |
postgres=# SELECT COUNT(*) FROM pg_class WHERE relname = 'FKTABLE_FAIL3';
|
test# ./regression.sh
src/k2/postgres/src/test/regress/chogori_schedule
*** 767,773 ****
-- Test for referencing column number smaller than referenced constraint
CREATE TABLE PKTABLE (ptest1 int, ptest2 int, UNIQUE(ptest1, ptest2));
CREATE TABLE FKTABLE_FAIL1 (ftest1 int REFERENCES pktable(ptest1));
! ERROR: there is no unique constraint matching given keys for referenced table "pktable"
SELECT COUNT(*) FROM pg_class WHERE relname = 'FKTABLE_FAIL1';
count
--- 767,773 ----
-- Test for referencing column number smaller than referenced constraint
CREATE TABLE PKTABLE (ptest1 int, ptest2 int, UNIQUE(ptest1, ptest2));
CREATE TABLE FKTABLE_FAIL1 (ftest1 int REFERENCES pktable(ptest1));
! ERROR: Invalid argument: Duplicate table
SELECT COUNT(*) FROM pg_class WHERE relname = 'FKTABLE_FAIL1';
count
The text was updated successfully, but these errors were encountered: