PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15853
PG Version11.3
OSArch Linux
Opened2019-06-15 08:47:16+00
Reported bywondertx
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15853
Logged by:          wondertx
Email address:      (redacted)
PostgreSQL version: 11.3
Operating system:   Arch Linux
Description:        

The following SQL executed will drop the sequence `t_id_seq`:
CREATE TABLE t(id SERIAL, value INT NOT NULL);
CREATE TABLE t_bak  LIKE t INCLUDING DEFAULTS INCLUDING INDEXES INCLUDING
COMMENTS INCLUDING CONSTRAINTS);
DROP TABLE t CASCADE;
This will drop default value of column `value` in t_bak.
However, the following SQL will not drop the sequence:
CREATE TABLE t(id SERIAL, value INT NOT NULL);
DROP SEQUENCE t_id_seq;
CREATE SEQUENCE t_id_seq;
ALTER TABLE T ALTER COLUMN ID SET DEFAULT NEXTVAL('t_id_seq'::regclass);
CREATE TABLE t_bak  LIKE t INCLUDING DEFAULTS INCLUDING INDEXES INCLUDING
COMMENTS INCLUDING CONSTRAINTS);
DROP TABLE t CASCADE;

Messages

DateAuthorSubject
2019-06-15 08:47:16+00PG Bug reporting formBUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on
2019-06-15 11:35:49+00"David G(dot) Johnston"Re: BUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on
2019-06-15 16:13:58+00Alvaro HerreraRe: BUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on
2019-06-15 16:43:33+00Tom LaneRe: BUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on
2019-06-17 02:08:38+00Tao XuRe: BUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on