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

atlas schema diff errors out on specific PostgreSQL comparison #3225

Open
pauliedoherty opened this issue Nov 20, 2024 · 0 comments
Open

atlas schema diff errors out on specific PostgreSQL comparison #3225

pauliedoherty opened this issue Nov 20, 2024 · 0 comments

Comments

@pauliedoherty
Copy link

atlas schema diff returns error message -

Error: sql: Scan error on column index 0, name "?column?": sql/driver: couldn't convert <nil> (<nil>) into type bool

This error occurs in 2 specific cases(tested on postgres 13.16 and 13.11):

Case 1:

database 1:

create database db1;
\c db1
CREATE TABLE tab(
    col VARCHAR(3) DEFAULT 'UNK'
);

database 2:

create database db2;
\c db2
CREATE TABLE tab(
    col VARCHAR(3) DEFAULT NULL
);

run atlas:

atlas schema diff \
  --from "postgres://postgres:password@host:5432/db1?search_path=public" \
  --to "postgres://postgres:password@host:5432/db2?search_path=public"

Case 2:

database 1:

create database db1;
\c db1
CREATE TABLE tab(
    col VARCHAR(32) DEFAULT NULL
);

database 2:

create database db2;
\c db2
CREATE TABLE tab(
    col VARCHAR(32) DEFAULT 'something'
);

run atlas

atlas schema diff \
  --from "postgres://postgres:password@host:5432/db1?search_path=public" \
  --to "postgres://postgres:password@host:5432/db2?search_path=public"

Both these cases result in error mentioned above.

I have been able to work around this error, but it caused me a lot of heartache.

Any insights would be greatly appreciated.

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