Skip to content

type wrongly reported as serial/bigserial #99

Description

@xpusostomos

As you would know, postgres has data types serial/bigserial that creates a field with a default value of the nextval of a sequence, and sets that sequence to be owned by that field. So there's 4 things to a serial/big serial, the type, the default pointing to a sequence in the default place (aka table_name_field_name), the existence of that sequence, and the ownership of the sequence by that field.

So we have a database that has a field with a default value from a sequence, but it's not an auto-generated serial, it's a hand coded setup. (We don't have one sequence per table, we have one for all tables, so it's not the serial version of table_name_field_name). In squirrel it shows as a "bigserial". So I'm guessing that squirrel did some analysis of the field and wrongly decided that its a serial? Because as far as I can tell, postgres itself forgets its a serial. pg_dump, dumps it out as 4 components, the field, the default, the sequence and the ownership.

Assuming I'm correct and squirrelsql is wrongly guessing the type of serial, I would suggest it's not really worth you trying to do such a guess. You could do all the analysis to do it, but for little gain. If this value is coming from postgres somehow, I'd be interested know how it comes from postgres.

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