cannot CREATE INDEX because it has pending trigger events

2019-08-27 Thread Simon Kissane
Hi We have an application that works fine with Postgres 9.6, but fails with this error when we try installing it against 11.5 I simplified the problem down to the following reproduce script: BEGIN TRANSACTION; CREATE TABLE resource (resource_id BIGINT NOT NULL PRIMARY KEY, resource_type BIGINT

Re: cannot CREATE INDEX because it has pending trigger events

2019-08-27 Thread Laurenz Albe
On Tue, 2019-08-27 at 12:00 +1000, Simon Kissane wrote: > We have an application that works fine with Postgres 9.6, but fails > with this error when we try installing it against 11.5 > > I simplified the problem down to the following reproduce script: > > BEGIN TRANSACTION; > CREATE TABLE resourc

Re: cannot CREATE INDEX because it has pending trigger events

2019-08-27 Thread Luca Ferrari
On Tue, Aug 27, 2019 at 9:33 AM Simon Kissane wrote: > If I swap the order of the CREATE UNIQUE INDEX and the INSERT, so the index > gets created first, the error doesn't happen. It also works removing the INITIALLY DEFERRED from the foreign key, since it seems you are creating tuples in the rig

Re: cannot CREATE INDEX because it has pending trigger events

2019-08-28 Thread Simon Kissane
On Tue, Aug 27, 2019 at 5:59 PM Laurenz Albe wrote: > > On Tue, 2019-08-27 at 12:00 +1000, Simon Kissane wrote: > > We have an application that works fine with Postgres 9.6, but fails > > with this error when we try installing it against 11.5 > > > > I simplified the problem down to the following