1

In PostGreSQL, can the SERIAL type start at 0?

This documentation states the range of the SERIAL type starts at 1.

Does this mean it's impossible ?

This question is not a duplicate. The other question is about Prisma and not discoverable for someone looking for an answer about PostGreSQL specifically

cassepipe
  • 371
  • 6
  • 16
  • This has been answered as an answer to another question: https://stackoverflow.com/a/75679539/10469162 – cassepipe Mar 09 '23 at 10:26
  • See https://stackoverflow.com/questions/62010838/reset-postgres-auto-increment-value-to-0, https://stackoverflow.com/questions/5561244/changing-minvalue-of-postgress-sequence and more – Bergi Jul 15 '23 at 16:41
  • If the document already tells you the answer, why ask the question ? – Rohit Gupta Jul 16 '23 at 12:52
  • @RohitGupta Maybe the question is poorly worded then but has merit : If you saw the answer I linked to in the comment you could have read: "Although serial occupies the place of data type in the ddl it is not a data type; it is actually a short for..." . Maybe a better question would be : "Is there an alternative to SERIAL that can start at 0" ? – cassepipe Aug 08 '23 at 07:56

0 Answers0