---
source: cubesql/src/compile/mod.rs
assertion_line: 5991
expression: "execute_query(\"SELECT\n                    current_database() AS PKTABLE_CAT,\n                    pkn.nspname AS PKTABLE_SCHEM,\n                    pkc.relname AS PKTABLE_NAME,\n                    pka.attname AS PKCOLUMN_NAME,\n                    current_database() AS FKTABLE_CAT,\n                    fkn.nspname AS FKTABLE_SCHEM,\n                    fkc.relname AS FKTABLE_NAME,\n                    fka.attname AS FKCOLUMN_NAME,\n                    pos.n AS KEY_SEQ,\n                    CASE\n                        con.confupdtype\n                        WHEN 'c' THEN 0\n                        WHEN 'n' THEN 2\n                        WHEN 'd' THEN 4\n                        WHEN 'r' THEN 1\n                        WHEN 'p' THEN 1\n                        WHEN 'a' THEN 3\n                        ELSE NULL\n                    END AS UPDATE_RULE,\n                    CASE\n                        con.confdeltype\n                        WHEN 'c' THEN 0\n                        WHEN 'n' THEN 2\n                        WHEN 'd' THEN 4\n                        WHEN 'r' THEN 1\n                        WHEN 'p' THEN 1\n                        WHEN 'a' THEN 3\n                        ELSE NULL\n                    END AS DELETE_RULE,\n                    con.conname AS FK_NAME,\n                    pkic.relname AS PK_NAME,\n                    CASE\n                        WHEN con.condeferrable\n                        AND con.condeferred THEN 5\n                        WHEN con.condeferrable THEN 6\n                        ELSE 7\n                    END AS DEFERRABILITY\n                FROM\n                    pg_catalog.pg_namespace pkn,\n                    pg_catalog.pg_class pkc,\n                    pg_catalog.pg_attribute pka,\n                    pg_catalog.pg_namespace fkn,\n                    pg_catalog.pg_class fkc,\n                    pg_catalog.pg_attribute fka,\n                    pg_catalog.pg_constraint con,\n                    pg_catalog.generate_series(1, 32) pos(n),\n                    pg_catalog.pg_class pkic,\n                    pg_catalog.pg_depend dep\n                WHERE\n                    pkn.oid = pkc.relnamespace\n                    AND pkc.oid = pka.attrelid\n                    AND pka.attnum = con.confkey [pos.n]\n                    AND con.confrelid = pkc.oid\n                    AND fkn.oid = fkc.relnamespace\n                    AND fkc.oid = fka.attrelid\n                    AND fka.attnum = con.conkey [pos.n]\n                    AND con.conrelid = fkc.oid\n                    AND con.contype = 'f'\n                    AND pkic.relkind = 'i'\n                    AND con.oid = dep.objid\n                    AND pkic.oid = dep.refobjid\n                    AND dep.classid = 'pg_constraint' :: regclass :: oid\n                    AND dep.refclassid = 'pg_class' :: regclass :: oid\n                    AND fkn.nspname = 'public'\n                    AND fkc.relname = 'Orders'\n                ORDER BY\n                    pkn.nspname,\n                    pkc.relname,\n                    con.conname,\n                    pos.n\".to_string(),\n            DatabaseProtocol::PostgreSQL).await?"
---
+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+
| PKTABLE_CAT | PKTABLE_SCHEM | PKTABLE_NAME | PKCOLUMN_NAME | FKTABLE_CAT | FKTABLE_SCHEM | FKTABLE_NAME | FKCOLUMN_NAME | KEY_SEQ | UPDATE_RULE | DELETE_RULE | FK_NAME | PK_NAME | DEFERRABILITY |
+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+
+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+
