You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using,expressions,include,nulls_not_distinct,where=inddef.scan(/ USING (\w+?) \((.+?)\)(?: INCLUDE \((.+?)\))?( NULLS NOT DISTINCT)?(?: WHERE (.+))?\z/m).flatten
SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete, c.convalidated AS valid, c.condeferrable AS deferrable, c.condeferred AS deferred, c.conkey, c.confkey, c.conrelid, c.confrelid
591
+
SELECT t2.oid::regclass::text AS to_table, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete, c.convalidated AS valid, c.condeferrable AS deferrable, c.condeferred AS deferred, c.conrelid, c.confrelid,
592
+
(
593
+
SELECT array_agg(a.attname ORDER BY idx)
594
+
FROM (
595
+
SELECT idx, c.conkey[idx] AS conkey_elem
596
+
FROM generate_subscripts(c.conkey, 1) AS idx
597
+
) indexed_conkeys
598
+
JOIN pg_attribute a ON a.attrelid = t1.oid
599
+
AND a.attnum = indexed_conkeys.conkey_elem
600
+
) AS conkey_names,
601
+
(
602
+
SELECT array_agg(a.attname ORDER BY idx)
603
+
FROM (
604
+
SELECT idx, c.confkey[idx] AS confkey_elem
605
+
FROM generate_subscripts(c.confkey, 1) AS idx
606
+
) indexed_confkeys
607
+
JOIN pg_attribute a ON a.attrelid = t2.oid
608
+
AND a.attnum = indexed_confkeys.confkey_elem
609
+
) AS confkey_names
595
610
FROM pg_constraint c
596
611
JOIN pg_class t1 ON c.conrelid = t1.oid
597
612
JOIN pg_class t2 ON c.confrelid = t2.oid
598
-
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
599
-
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
0 commit comments