If you don’t want to retain the ordering of ids, then you can
ALTER SEQUENCE seq RESTART WITH 1;
UPDATE t SET idcolumn=nextval('seq');
I doubt there’s an easy way to do that in the order of your choice without recreating the whole table.
More Related Contents:
- Why does PostgreSQL perform sequential scan on indexed column?
- In-order sequence generation
- Insert, on duplicate update in PostgreSQL?
- How does the search_path influence identifier resolution and the “current schema”
- How do you find the row count for all your tables in Postgres
- Run batch file with psql command without password
- invalid byte sequence for encoding “UTF8”
- Postgresql: Conditionally unique constraint
- How do you use variables in a simple PostgreSQL script?
- How to switch databases in psql?
- Postgresql: Scripting psql execution with password
- Postgresql Truncation speed
- Buffers (Circle) in PostGIS
- docker postgres pgadmin local connection
- How to customize the configuration file of the official PostgreSQL Docker image?
- Does a Postgres UNIQUE constraint imply an index?
- SELECT raises exception in PL/pgSQL function
- Dynamically generate columns for crosstab in PostgreSQL
- I forgot the password I entered during PostgreSQL installation
- Function to loop through and select data from multiple tables
- SQL query column does not exist error
- SQL Sub queries in check constraint
- Postgresql enforce unique two-way combination of columns
- PostgreSQL how to concat interval value ‘2 days’
- Displaying image in Ireports using PostgreSql
- Orbeon Forms Postgres DB connection
- Postgres default sort by id – worldship
- Best way to install hstore on multiple schemas in a Postgres database?
- Loop through columns of RECORD
- How to drop PostgreSQL database through command line [closed]