Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 75908

An object that can generate unique integers.

0 votes

When postgresql sequences get out of sync?

I did not know that PostgreSQL implemented SERIAL columns with an associated sequence, and when the new table got a new sequence that started at 1, I got duplicates in the table when I started inserting … So this is probably not what is happening to you, if the sequence is being reset to 1. What I had was a new sequence being created. …
PhilHibbs's user avatar
  • 539
9 votes
1 answer
18k views

How to get the sequence name for a serial column

pg_attrdef d on d.adrelid = x.attrelid and d.adnum = x.attnum where x.relname = 'table_name' and x.nspname = 'schema_name' and x.attname = 'column_name' ; It works most of the time, but if I rename the sequence … , the new name is not reflected in the result of the query - it continues to show the original name of the sequence. …
PhilHibbs's user avatar
  • 539