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

.dump generates invalid NULL in output for tables that have a UNIQUE constraint #150

Open
CodingDoug opened this issue Aug 16, 2023 · 0 comments

Comments

@CodingDoug
Copy link
Contributor

Run the following SQL, noting the UNIQUE:

CREATE TABLE example_gid_counts (
    gid TEXT UNIQUE NOT NULL,
    row_count INTEGER NOT NULL
);

Then run .dump:

CREATE TABLE example_gid_counts (
gid TEXT UNIQUE NOT NULL,
row_count INTEGER NOT NULL
);
NULL

Note the extra trailing NULL in the output, which causes problems when loaded back into a database.

Without UNIQUE it works as expected:

CREATE TABLE example_gid_counts (
    gid TEXT NOT NULL,
    row_count INTEGER NOT NULL
);

.dump:

CREATE TABLE example_gid_counts (
gid TEXT NOT NULL,
row_count INTEGER NOT NULL
);
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