我有一個問題,我試圖插入新行到一個Postgres數據庫表,並收到以下錯誤無法將新行插入到postgres數據庫表中?
ERROR: duplicate key violates unique constraint "n_clients_pkey"
這裏我查詢
insert into n_clients(client_name) values('value');
我使用的Postgres 8.1。 11
PostgreSQL 8.1.11 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)
下面是我的表結構
Table "public.n_clients"
Column | Type | Modifiers
-------------+--------------------------+-----------------------------------------------------------------------
id | integer | not null default nextval(('public.n_clients_id_seq'::text)::regclass)
client_name | character varying(200) | not null
moddate | timestamp with time zone | default now()
createdate | timestamp with time zone | default now()
Indexes:
"n_clients_pkey" PRIMARY KEY, btree (id)
和序列
Sequence "public.n_clients_id_seq"
Column | Type
--------------- + --------- SEQUENCE_NAME |名字 last_value | bigint increment_by | bigint max_value | bigint min_value | bigint cache_value | bigint log_cnt | bigint is_cycled |布爾值 is_called | boolean
你能爲n_clients表添加您的CREATE TABLE命令。 – 2009-09-23 11:06:17
我更新了我的問題,請看我的表格結構 – Roland 2009-09-23 11:08:32