- 论坛徽章:
- 0
|
测试步骤
1. 1. CREATE TABLE customer
2. (
3. customer_id SERIAL NOT NULL PRIMARY KEY,
4. name varchar(50)
5. );
2. 1. INSERT INTO customer (name) values('Customer 1');
2. INSERT INTO customer (name) values('Customer 2');
3. 1. INSERT INTO customer (customer_id,name) values(3,'Customer 3');
2. INSERT INTO customer (customer_id,name) values(4,'Customer 4');
3. INSERT INTO customer (customer_id,name) values(5,'Customer 5');
4. 1. INSERT INTO customer (name) values('Customer 6');
2.
3. ----------------------------------------------------------------------
4. ERROR: duplicate key value violates unique constraint "customer_pkey"
5.
6. ********** Error **********
7.
8. ERROR: duplicate key value violates unique constraint "customer_pkey"
9. SQL state: 23505
如何解决这种问题?实际上pg 备份后再还原的 copy 命令也会导致这种问题。 |
|