Created
August 26, 2020 11:28
-
-
Save denishpatel/89f8d8a48fe418fc16c36ea9b81168a5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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