これは私のテーブルweb_bookのスキームです:
Column | Type | Modifiers
----------------+------------------------+-------------------------------------------------------
id | integer | not null default nextval('web_book_id_seq'::regclass)
page_count | integer | not null
year_published | integer | not null
file | character varying(100) | not null
image | character varying(100) | not null
display_on_hp | boolean | not null
name | character varying(128) | not null
description | text | not null
name_cs | character varying(128) |
name_en | character varying(128) |
description_cs | text |
description_en | text |
テーブルには、 を含む 1 つの行が含まれていid=3
ます。行を複製したいのですが、これを試してみると:
INSERT INTO web_book SELECT * FROM web_book WHERE id=3;
私はこれを得る:
ERROR: duplicate key value violates unique constraint "web_book_pkey"
DETAIL: Key (id)=(3) already exists