Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: do not use pg_depend against PostgreSQL 9.0+ (#689)
Previously, `getImportedExportedKeys` needed to use `pg_depend` to determine the index that supported a foreign key constraint. This was done by joining `pg_depend` with `pg_constraint` to find the dependency between the foreign key constraint and a row in `pg_class` with type index. Starting in version 9.0 of postgres, `pg_constraint` was extended with the `conindid` column. This column gives us exactly what we want: for foreign key constraint rows, `conindid` is the `oid` of the index that supports the constraint. This commit uses `pg_constraint.conindid` when the server version is new enough instead of joining against `pg_depend`.
- Loading branch information
Showing with 16 additions and 3 deletions.