【发布时间】:2015-04-03 07:56:04
【问题描述】:
谷歌搜索告诉我试试这个:
insert into Plan default values;
但我得到了:
null value in column "id" violates not-null constraint
或者这个:
insert into Plan (id) values (null);
但我得到了同样的东西。
这些示例是针对 SQL 的:PostgreSQL 有什么不同吗?
表结构:
create table Plan (
id int4 not null,
primary key (id)
);
【问题讨论】:
-
你能展示一下你的表结构吗?!
-
"示例用于 SQL" - 没有意义。 Postgres 是使用 SQL。
标签: sql postgresql primary-key auto-increment sql-insert