Re: Assertion failure with ALTER TABLE ATTACH PARTITION with log_min_messages >= DEBUG1

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assertion failure with ALTER TABLE ATTACH PARTITION with log_min_messages >= DEBUG1
Date: 2018-10-05 15:41:29
Message-ID: 20181005154129.34dfz2wn7aise2sd@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Oct-05, Michael Paquier wrote:

> Looking at the stack trace there is this log in
> validateForeignKeyConstraint:
> ereport(DEBUG1,
> (errmsg("validating foreign key constraint \"%s\"", conname)));
>
> However conname is set to NULL in this code path.

Ouch. Thanks for catching this one. I think the "this is all we need"
comment is just asking for trouble :-(

> From what I can see the problem comes from CloneForeignKeyConstraint
> which forgets to assign the constraint name when cloning the FK
> definition. While looking at the ATTACH PARTITION code, I have noticed
> that a variable gets overridden, which is in my opinion bad style.

Ugh, yeah that looks bad. I wish the compiler would warn about this :-(

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Catalin Iacob 2018-10-05 15:47:36 Re: NOTIFY and pg_notify performance when deduplicating notifications
Previous Message Peter Eisentraut 2018-10-05 15:40:00 Re: Jsonb transform for pl/python