Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    I don't feel like this really answered the question as to how to get bigserial on an existing column. Are you saying that setting a serial on bigint will result in it being bigserial? Commented Jul 6, 2018 at 20:22
  • 3
    @Amalgovinus: Basically, yes. Postgres doesn't actually keep track of whether a column was created as a SERIAL type. If you look at the pg_dump output for a table with a BIGSERIAL, you'll just see a BIGINT and a sequence (and creating the BIGINT and the sequence yourself is exactly the same as using the BIGSERIAL keyword). Note that, as of Postgres 10, you have the option of turning it into an identity column instead. Commented Jul 7, 2018 at 0:03