I have a table which is:
CREATE SEQUENCE id_seq;
CREATE TABLE public."UserInfo"
(
id bigint NOT NULL DEFAULT nextval('id_seq'),
phone text,
password text,
name text,
surname text,
middle_name text,
email text,
company text,
title text,
image_id text,
CONSTRAINT "UserInfo_pkey" PRIMARY KEY (id),
CONSTRAINT "UserInfo_image_id_key" UNIQUE (image_id),
CONSTRAINT "UserInfo_phone_key" UNIQUE (phone)
)
WITH (
OIDS=FALSE
);
ALTER SEQUENCE id_seq OWNED BY public."UserInfo".id;
ALTER TABLE public."UserInfo"
OWNER TO postgres;
When I make bad request for insert like same value for unique column. "id" is increasing... Here is bad id request;
ERROR: null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, 9921455867, mg123209, name, surname, , [email protected], Company Name, Title Of Person, 123asd).
********** Error **********
Here is my table result ;
1;"1234477867";"qweff";"Name";"Surname";"''";"[email protected]";"Company";"Title";"qwer1234"
4;"5466477868";"1235dsf";"Name";"Surname";"''";"[email protected]";"Company";"Title";"qwer1235"
6;"5051377828";"asd123";"Name";"Surname";"''";"[email protected]";"Company";"Title";"qwesr1235"
Please help me how I can solve this issue, I want order like 1,2,3.
. sequential..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…