pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Duncan Sands <duncan.sands@deepbluecap.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: pg_restore with --disable-triggers discards ENABLE ALWAYS
Date: Fri, 13 Sep 2024 11:04:07 +0200
Message-ID: <efe94b68-24f6-49c6-8283-8deb2f8b05d8@deepbluecap.com> (raw)
In-Reply-To: <4156698.1726174027@sss.pgh.pa.us>
References: <d374b6fc-4217-48a9-8639-2c9b4d3a92d0@deepbluecap.com>
	<78a13f951a03bf325027f8dcfb32b1b5089cdb14.camel@cybertec.at>
	<4156698.1726174027@sss.pgh.pa.us>

Hi Tom, thanks for taking a look.

 > The given recipe seems incomplete,

I'm not sure what is missing in the recipe.  I just dropped and recreated the 
database, and performed exactly the steps listed in my original email, and get 
exactly the same result.

 > but I think Duncan has put his
> finger on a shortcoming.  pg_restore with --disable-triggers will
> issue
> 
> ALTER TABLE foo DISABLE TRIGGER ALL;
> 
> and later
> 
> ALTER TABLE foo ENABLE TRIGGER ALL;
> 
> and if you read the fine print in the ALTER TABLE man page,
> you'll discover that ENABLE TRIGGER sets the triggers' replication
> mode to the default (origin only).  I'm not sure why somebody
> thought that replication mode shouldn't be stored separately
> from enable/disable, but it isn't: there's just one four-valued
> state field.
> 
> We could probably add code to make pg_dump individually re-enable
> the table's triggers with the appropriate state(s), but I can't
> muster too much enthusiasm for writing that myself.





view thread (6+ messages)  latest in thread

Message-ID: <efe94b68-24f6-49c6-8283-8deb2f8b05d8@deepbluecap.com>
Permalink:  ../efe94b68-24f6-49c6-8283-8deb2f8b05d8@deepbluecap.com/
Also on:    postgresql.org/message-id/efe94b68-24f6-49c6-8283-8deb2f8b05d8@deepbluecap.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: duncan.sands@deepbluecap.com, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, pgsql-bugs@lists.postgresql.org
  Subject: Re: pg_restore with --disable-triggers discards ENABLE ALWAYS
  In-Reply-To: <efe94b68-24f6-49c6-8283-8deb2f8b05d8@deepbluecap.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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