Re:Understanding Postgres Performance
by craigkerstiens on Tuesday October 02, 2012 @12:15PM
(#4602712)
What content would you like to see within Postgresguide?
[ Parent
| on HN ]
Re:Understanding Postgres Performance
by jcampbell1 on Tuesday October 02, 2012 @12:38PM
(#4602832)
Probably a good idea to add a bit about serial, and sequences. This tends to confuse mysql people like myself.
I for instance don't know what happens when I copy or dump and restore a postgres table that relies on a sequence. Mysql auto-magically takes care of it by saving the next auto increment id in table dump or copy.
If you use pg_dump to dump/restore the table, it will reset the sequence to the correct value. Look at the dump file, there will be a setval of the sequence.
Agreed, especially since sequences is a more powerful tool with a wider use than auto increment. For example you can use the same sequence for multiple tables, or use them without being connected to any table.