我正在尝试使用 pgadmin3 运行以下插入语句:
INSERT INTO device
VALUES
(12345,
'asdf',
'OY8YuDFLYdv',
'2',
'myname',
'2013-04-24 11:30:08',
Null,Null)
但我不断收到以下错误消息:
ERROR: invalid input syntax for integer: "asdf"
LINE 4: 'asdf',
^
********** Error **********
ERROR: invalid input syntax for integer: "asdf"
SQL state: 22P02
Character: 42
这是表定义:
CREATE TABLE device
(
device_id integer NOT NULL DEFAULT nextval('device_device_id_seq'::regclass),
userid integer NOT NULL,
description character varying(255),
password character varying(255) NOT NULL,
user_id integer NOT NULL,
createdname character varying(255),
createddatetime timestamp without time zone,
updatedname character varying(255),
updateddatetime timestamp without time zone,
CONSTRAINT device_pkey PRIMARY KEY (device_id )
)
WITH (
OIDS=FALSE
);
ALTER TABLE device
OWNER TO appadmin;
你能告诉我哪里出错了吗?我尝试将单引号更改为双引号,但这没有帮助。如果不需要,我不想在 INSERT 中列出所有列名。
谢谢。