New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use `pg_depend` against postgres 9.0+ #689

Merged
merged 1 commit into from Nov 15, 2016

Conversation

Projects
None yet
4 participants
@jordanlewis
Contributor

jordanlewis commented Nov 15, 2016

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.

Do not use `pg_depend` against postgres 9.0+
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`.

@jordanlewis jordanlewis force-pushed the jordanlewis:replace_pg_depend branch from cc4ab90 to 462d505 Nov 15, 2016

@codecov-io

This comment has been minimized.

codecov-io commented Nov 15, 2016

Current coverage is 63.23% (diff: 66.66%)

Merging #689 into master will increase coverage by 1.28%

@@             master       #689   diff @@
==========================================
  Files           150        150          
  Lines         14702      14708     +6   
  Methods           0          0          
  Messages          0          0          
  Branches       2907       2909     +2   
==========================================
+ Hits           9108       9301   +193   
+ Misses         4450       4217   -233   
- Partials       1144       1190    +46   

Powered by Codecov. Last update 8a95d99...462d505

@davecramer

Looks fine to me

@vlsi vlsi added this to the 9.4.1213 milestone Nov 15, 2016

@vlsi vlsi merged commit 62e25fb into pgjdbc:master Nov 15, 2016

2 checks passed

codecov/project 63.23% (+1.28%) compared to 8a95d99
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jordanlewis

This comment has been minimized.

Contributor

jordanlewis commented Nov 15, 2016

Thanks guys!

@jordanlewis jordanlewis deleted the jordanlewis:replace_pg_depend branch Nov 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment