make the tests parallelizeable

helper view table_fkeys_in_workers now allows filtering by schema so that a test case can print out foreign keys in its schema only
pull/2488/head
Hanefi Onaldi 2018-11-23 10:57:53 +03:00
parent b3d897039a
commit 4edb193f25
5 changed files with 13 additions and 5 deletions

View File

@ -35,7 +35,9 @@ SELECT
relid::regclass::text,
refd_relid::regclass::text
FROM
table_fkey_cols
table_fkey_cols
WHERE
"schema" = 'fkey_reference_table'
)
d $$ )).RESULT::json )::json )).* ;
CREATE TABLE referenced_table(id int UNIQUE, test_column int);

View File

@ -35,7 +35,9 @@ SELECT
relid::regclass::text,
refd_relid::regclass::text
FROM
table_fkey_cols
table_fkey_cols
WHERE
"schema" = 'fkey_reference_table'
)
d $$ )).RESULT::json )::json )).* ;
CREATE TABLE referenced_table(id int UNIQUE, test_column int);

View File

@ -17,7 +17,8 @@ SELECT rc.constraint_name AS "name",
kcu.column_name AS "column_name",
uc_kcu.column_name AS "refd_column_name",
format('%I.%I', kcu.table_schema, kcu.table_name)::regclass::oid AS relid,
format('%I.%I', uc_kcu.table_schema, uc_kcu.table_name)::regclass::oid AS refd_relid
format('%I.%I', uc_kcu.table_schema, uc_kcu.table_name)::regclass::oid AS refd_relid,
rc.constraint_schema AS "schema"
FROM information_schema.referential_constraints rc,
information_schema.key_column_usage kcu,
information_schema.key_column_usage uc_kcu

View File

@ -27,7 +27,9 @@ SELECT
relid::regclass::text,
refd_relid::regclass::text
FROM
table_fkey_cols
table_fkey_cols
WHERE
"schema" = 'fkey_reference_table'
)
d $$ )).RESULT::json )::json )).* ;

View File

@ -19,7 +19,8 @@ SELECT rc.constraint_name AS "name",
kcu.column_name AS "column_name",
uc_kcu.column_name AS "refd_column_name",
format('%I.%I', kcu.table_schema, kcu.table_name)::regclass::oid AS relid,
format('%I.%I', uc_kcu.table_schema, uc_kcu.table_name)::regclass::oid AS refd_relid
format('%I.%I', uc_kcu.table_schema, uc_kcu.table_name)::regclass::oid AS refd_relid,
rc.constraint_schema AS "schema"
FROM information_schema.referential_constraints rc,
information_schema.key_column_usage kcu,
information_schema.key_column_usage uc_kcu