Is it necessary or important to rename table sequences and primary keys when we rename a table in PostgreSQL? Does it affect something?
2 Answers
Technically your database will keep working as always without the rename so I would say it depends. If your primary key has a generic name like id obviously it is still valid regardless of the new table name. If the name is in the form old_table_name_id or something like that then you have semantic inconsistency. In larger projects this can be confusing for humans. Good names are important just like they are in code so I would rename in this case. Same goes for sequences.