Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-08-14 Thread Alvaro Herrera
On 2019-Aug-14, Tom Lane wrote: > Alvaro Herrera writes: > > On 2019-Jul-22, Alvaro Herrera wrote: > >> After looking at the code some more, I think calling the new function in > >> the Prep phase is correct. The attached patch is pretty much final form > >> for this bugfix. I decided to unwrap

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-08-14 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Jul-22, Alvaro Herrera wrote: >> After looking at the code some more, I think calling the new function in >> the Prep phase is correct. The attached patch is pretty much final form >> for this bugfix. I decided to unwrap a couple of error messages (I did >> get b

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-23 Thread Alvaro Herrera
On 2019-Jul-22, Alvaro Herrera wrote: > After looking at the code some more, I think calling the new function in > the Prep phase is correct. The attached patch is pretty much final form > for this bugfix. I decided to unwrap a couple of error messages (I did > get bitten while grepping because

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-22 Thread Alvaro Herrera
On 2019-Jul-17, Alvaro Herrera wrote: > On 2019-Jul-17, Alvaro Herrera wrote: > > I wonder if there are other AT subcommands that are similarly broken, > > because many of them skip the CheckTableNotInUse for the partitions. > > I suppose the question here is where else do we need to call the ne

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-17, Alvaro Herrera wrote: > Actually, that doesn't fix this problem, because the partitioned side is > the *referencing* side, and ATExecDropConstraint is obsessed about the > *referenced* side only and assumes that the calling code has already > dealt with the referencing side checks.

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-17, Alvaro Herrera wrote: > I think we should just run CheckTableNotInUse for each partition in > ATExecDropConstraint. Trying that out now. Actually, that doesn't fix this problem, because the partitioned side is the *referencing* side, and ATExecDropConstraint is obsessed about the

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-16, Tom Lane wrote: > Rajkumar Raghuwanshi writes: > > I am getting ERROR: relation 16401 has no triggers error while executing > > below query. > > Yeah, I can reproduce that back to v11. If you try the same scenario > with a non-partitioned table you get > > ERROR: 55006: canno

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-16 Thread Tom Lane
Rajkumar Raghuwanshi writes: > I am getting ERROR: relation 16401 has no triggers error while executing > below query. Yeah, I can reproduce that back to v11. If you try the same scenario with a non-partitioned table you get ERROR: 55006: cannot ALTER TABLE "tbl2" because it has pending trigg

Re: getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-16 Thread Michael Paquier
On Tue, Jul 16, 2019 at 01:07:45PM +0530, Rajkumar Raghuwanshi wrote: > I am getting ERROR: relation 16401 has no triggers error while executing > below query. Indeed, confirmed. I can reproduce that down to v11, so that's not an open item. I have added an entry in the section for older issues

getting ERROR "relation 16401 has no triggers" with partition foreign key alter

2019-07-16 Thread Rajkumar Raghuwanshi
Hi, I am getting ERROR: relation 16401 has no triggers error while executing below query. postgres=# create table tbl1(f1 int primary key); CREATE TABLE postgres=# create table tbl2(f1 int references tbl1 deferrable initially deferred) partition by range(f1); CREATE TABLE postgres=# create table