Re: Assert failure in ATPrepAddPrimaryKey

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert failure in ATPrepAddPrimaryKey
Date: 2023-09-01 11:48:00
Message-ID: 20230901114800.3yt3oytgzlhtyw3h@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Sep-01, Richard Guo wrote:

> I ran into an Assert failure in ATPrepAddPrimaryKey() with the query
> below:
>
> CREATE TABLE t0(c0 boolean);
> CREATE TABLE t1() INHERITS(t0);
>
> # ALTER TABLE t0 ADD CONSTRAINT m EXCLUDE ((1) WITH =);
> server closed the connection unexpectedly

Ugh, right, I failed to make the new function do nothing for this case;
this had no coverage. Fix attached, with some additional test cases
based on yours.

Thanks for reporting.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"XML!" Exclaimed C++. "What are you doing here? You're not a programming
language."
"Tell that to the people who use me," said XML.
https://burningbird.net/the-parable-of-the-languages/

Attachment Content-Type Size
0001-Only-process-inheritance-for-primary-keys-not-other-.patch text/x-diff 4.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-09-01 12:37:17 Re: Move bki file pre-processing from initdb to bootstrap
Previous Message John Naylor 2023-09-01 11:31:14 Re: generate syscache info automatically