
October 24th, 2002, 03:23 PM
|
|
Contributing User
|
|
Join Date: Jul 2002
Posts: 155
Time spent in forums: 6 h 6 m 5 sec
Reputation Power: 7
|
|
|
Primary Key useage
Hi all. I've built the following table:
Code:
CREATE TABLE wms_users (user_id int4 PRIMARY KEY,
firstname character varying(255) NOT NULL,
lastname character varying(255) NOT NULL,
username character varying(25) NOT NULL,
password character varying(32) NOT NULL,
email character varying(255) NOT NULL,
clearance integer DEFAULT 1,
hint integer,
answer character varying(255),
status integer DEFAULT 1 NOT NULL,
added timestamp(0) without time zone DEFAULT now() NOT NULL
);
but when I try to execute the following insert statement:
Code:
insert into wms_users (firstname,lastname,username,password,email,clearance,status) values ('Debra','Bilous','debra','password','bilousd@unbc.ca',2,1);
I get the following error message:
ExecAppend: Fail to add null value in not null attribute user_id
I seem to remember in MySQL being able to define a column as a primary key and an insert statment as I've used above would have worked.
Can anyone tell me why I'm getting this error?
Thanks in advance,
Pablo
|