BUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15853: DROP TABLE CASCADE drops sequence that other tables depend on
Date
Msg-id 15853-b83a5170b0267679@postgresql.org
Whole thread Raw
Responses Re: BUG #15853: DROP TABLE CASCADE drops sequence that other tablesdepend on
Re: BUG #15853: DROP TABLE CASCADE drops sequence that other tablesdepend on
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15853
Logged by:          wondertx
Email address:      wondertx@gmail.com
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;


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15852: pgAdmin III tool - Password reset
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #15853: DROP TABLE CASCADE drops sequence that other tablesdepend on