Skip to content

Conversation

mshick
Copy link

@mshick mshick commented Oct 15, 2025

Prevents a failure to match sequences when introspecting non-default schemas by normalzing the seq_name column.

The seq_name, assigned as identityName in the Postgres introspection is treated as though it is an unqualified column name in multiple locations in the code.

This leads to several bugs when using a non-default schema, notably, any push to a database after the first push will generate a bad change set that attempts to alter the schema, often by trying to drop the sequence which failed these checks.

Concretely, given a push for my-schema.todo, the seq_name for an id column returned from the introspection query would be "my-schema".todo_id_seq, whereas a default public.todo table would return the unqualified todo_id_seq. All of the code is expecting and handling the default case only, for instance, concatenating the schema name with the seq_name generating keys like my-schema."my-schema".todo_id_seq and testing those against sequences that would have the key my-schema.todo_id_seq.

Prevents a failure to match sequences when introspecting non-default schemas.
seq_name use in app code assumes it is not fully-qualified
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

Successfully merging this pull request may close these issues.

1 participant