Syed Aslam

Thoughts, Stories, and Ideas

Re-initializing table sequence in postgresql

by Syed Aslam in Postgresql · 1 min read

Re-initializing a table sequence is quite normal and required in some cases. I had to do that recently. If the table has data and needs to be preserved, then temporarily you have to move the data, delete the data in original table and re-initialize the sequence and copy the original data again. Let's see how to re-initialize table sequence in PostgreSQL.

postgresql sequence

Adding close link to flash messages

by Syed Aslam in Rails · 1 min read

The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared out. Learn a way to add close buttons to flash messages in Rails templates.

rails flash