Created
August 26, 2020 11:28
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# select * from identity_always; | |
id | name | |
----+------ | |
1 | RJ | |
(1 row) | |
postgres=# alter table identity_always alter COLUMN id restart ; | |
ALTER TABLE | |
postgres=# insert into identity_always (name) values ('test'); | |
ERROR: duplicate key value violates unique constraint "identity_always_pkey" | |
DETAIL: Key (id)=(1) already exists. | |
postgres=# truncate identity_always restart identity; | |
TRUNCATE TABLE | |
postgres=# insert into identity_always (name) values ('test'); | |
INSERT 0 1 | |
postgres=# select * from identity_always; | |
id | name | |
----+------ | |
1 | test | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment