Skip to content
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

Exclusion index support #39

Open
zejn opened this issue Jul 10, 2018 · 0 comments
Open

Exclusion index support #39

zejn opened this issue Jul 10, 2018 · 0 comments

Comments

@zejn
Copy link

zejn commented Jul 10, 2018

Currently pgdiff outputs wrong migration for exclusion indexes, as it does not detect it's a special case. This is a generalization of unique constraint, a bit more info here -- https://www.postgresql.org/docs/current/static/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION

Setup DB1:

create extension btree_gist;
create table foo (a integer, b integer);
alter table foo add constraint foo_eidx exclude using gist (a with =, b with !=);

Setup DB2:

create extension btree_gist;
create table foo (a integer, b integer);

Output for INDEX:

./pgdiff -D db1 -d db2 -U user -u user -W xxx -w xxx  INDEX
-- schemaType: INDEX
-- db1: {db1 localhost 5432 user xxx * sslmode=disable}
-- db2: {db2 localhost 5432 user xxx * sslmode=disable}
-- Run the following SQL against db2:
CREATE INDEX foo_eidx ON foo USING gist (a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant