File: 10_foreignkey.sql

package info (click to toggle)
pgtt 4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: ansic: 1,547; sql: 569; makefile: 27; sh: 1
file content (19 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
----
-- Regression test to Global Temporary Table implementation
--
-- Test for unsupported foreign keys on GTT.
--
----
-- Import the library
-- LOAD 'pgtt';
-- Must throw ERROR: attempt to create referential integrity constraint on temporary table.
CREATE /*GLOBAL*/ TEMPORARY TABLE t2 (c1 integer, FOREIGN KEY (c1) REFERENCES source (id));
BEGIN;
CREATE /*GLOBAL*/ TEMPORARY TABLE t2 (c1 integer);
-- Must throw ERROR: attempt to create referential integrity constraint on temporary table.
ALTER TABLE t2 ADD FOREIGN KEY (c1) REFERENCES source (id);
ROLLBACK;
BEGIN;
-- Must be valid statement
CREATE TABLE t3 (c1 integer, FOREIGN KEY (c1) REFERENCES source (id));
ROLLBACK;