Skip to content

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

Description

@CodingDoug

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
);

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions