Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql reset auto increment

-- if you dont mind losing the data, do the following
TRUNCATE TABLE someTable RESTART IDENTITY;
Comment

postgresql reset auto_increment index

-- Change the starting value of the sequence

ALTER SEQUENCE project_id_seq RESTART 3000;

-- Same but dynamic :

SELECT SETVAL('project_id_seq', (SELECT MAX(id) + 1 FROM project));
Comment

PREVIOUS NEXT
Code Example
Sql :: show sqlite column names 
Sql :: Postgres upgrade to superuser 
Sql :: mysql strict_trans_tables 
Sql :: funzioni plsql 
Sql :: sql server add identity column to existing table 
Sql :: console output pl sql 
Sql :: get all records who register today in mysql 
Sql :: starting mysql service from mac 
Sql :: oracle synonym 
Sql :: sql remanecolumn 
Sql :: create user mysql 
Sql :: postgres truncate with cascade 
Sql :: set permanent SET GLOBAL sql_mode ubuntu 
Sql :: oracle session date format 
Sql :: install mysql in amazon linux 2 
Sql :: mysqldump csv 
Sql :: get rows affected mysql python 
Sql :: postgresql transaction discard all 
Sql :: mysql show all tables 
Sql :: last 6 months postgresql 
Sql :: how to move a columns location in mysql 
Sql :: différence entre deux dates sql oracle 
Sql :: reset sql auto increment 
Sql :: SQL query to convert DD/MM/YYYY to YYYY-MM-DD 
Sql :: how to get slow query log in mysql 
Sql :: mysql query unique column 
Sql :: find logged in users mysql 
Sql :: oracle tablespace datafile max size 
Sql :: sql ends with string 
Sql :: How to reset forgotten postgresql password 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =