Thread: PostgreSQL Constraints and Foreign Keys - Dropping Tables

PostgreSQL Constraints and Foreign Keys - Dropping Tables

From
Sbob
Date:
I just saw a post indicating that PostgreSQL Foreign Keys and 
Constraints are actually managed via triggers, therefore instead of 
doing a DROP TABLE CASCADE I could just disable triggers.


Is this true?


If so it 'feels' like there may be dangerous side effects, any thoughts 
on any cautions and gotcha's to this approach?


Thanks in advance




Re: PostgreSQL Constraints and Foreign Keys - Dropping Tables

From
"David G. Johnston"
Date:
On Thu, Dec 8, 2022 at 2:36 PM Sbob <sbob@quadratum-braccas.com> wrote:
I just saw a post indicating that PostgreSQL Foreign Keys and
Constraints are actually managed via triggers, therefore instead of
doing a DROP TABLE CASCADE I could just disable triggers.

Those two things don't produce the same end result...


If so it 'feels' like there may be dangerous side effects, any thoughts
on any cautions and gotcha's to this approach?


Why did you add constraints/foreign keys in the first place?

David J.