BIGSERIAL
已经是BIGINT
,它只是自动添加序列。如果这样做,您可以看到它\d a
。您将看到如下内容:
Table "public.a" Column | Type | Modifiers --------+--------+------------------------------------------------ id | bigint | not null default nextval('a_id_seq'::regclass) Indexes: "a_pkey" PRIMARY KEY, btree (id)
这样一来,您会看到序列名称:a_id_seq
。放下
=# DROP SEQUENCE a_id_seq CASCADE; NOTICE: drop cascades to default for table a column id DROP SEQUENCE =# \d a Table "public.a" Column | Type | Modifiers --------+--------+----------- id | bigint | not null Indexes: "a_pkey" PRIMARY KEY, btree (id)