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
feat: use pg_basetype() for domain type resolution on PG 17+
PostgreSQL 17 introduced pg_basetype() which natively resolves domain
types to their base types. Use this instead of the recursive CTE when
available, falling back to the recursive approach for older versions.
SQL.sql "set local schema ''"-- This voids the search path. The following queries need this for getting the fully qualified name(schema.name) of every db object
-- the tbl_constraints/key_col_usage CTEs are based on the standard "information_schema.table_constraints"/"information_schema.key_column_usage" views,
578
593
-- we cannot use those directly as they include the following privilege filter:
579
594
-- (pg_has_role(ss.relowner, 'USAGE'::text) OR has_column_privilege(ss.roid, a.attnum, 'SELECT, INSERT, UPDATE, REFERENCES'::text));
580
595
-- on the "columns" CTE, left joining on pg_depend and pg_class is used to obtain the sequence name as a column default in case there are GENERATED .. AS IDENTITY,
581
596
-- generated columns are only available from pg >= 10 but the query is agnostic to versions. dep.deptype = 'i' is done because there are other 'a' dependencies on PKs
0 commit comments