pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL Constraints and Foreign Keys - Dropping Tables
2+ messages / 2 participants
[nested] [flat]

* PostgreSQL Constraints and Foreign Keys - Dropping Tables
@ 2022-12-08 21:36 Sbob <sbob@quadratum-braccas.com>
  2022-12-08 21:40 ` Re: PostgreSQL Constraints and Foreign Keys - Dropping Tables David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Sbob @ 2022-12-08 21:36 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PostgreSQL Constraints and Foreign Keys - Dropping Tables
  2022-12-08 21:36 PostgreSQL Constraints and Foreign Keys - Dropping Tables Sbob <sbob@quadratum-braccas.com>
@ 2022-12-08 21:40 ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2022-12-08 21:40 UTC (permalink / raw)
  To: Sbob <sbob@quadratum-braccas.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-12-08 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-12-08 21:36 PostgreSQL Constraints and Foreign Keys - Dropping Tables Sbob <sbob@quadratum-braccas.com>
2022-12-08 21:40 ` David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox