pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: jian he <jian.universality@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: bug when apply fast default mechanism for adding new column over domain with default value
Date: Tue, 01 Apr 2025 21:05:48 -0400
Message-ID: <706572.1743555948@sss.pgh.pa.us> (raw)
In-Reply-To: <025a3ffa-5eff-4a88-97fb-8f583b015965@gmail.com>
References: <CACJufxHFssPvkP1we7WMhPD_1kwgbG52o=kQgL+TnVoX5LOyCQ@mail.gmail.com>
	<2901599.1740811424@sss.pgh.pa.us>
	<CACJufxG97GWGC3kczph04JjLHKGDMH4oVou1_yXKHxFSqAHwBQ@mail.gmail.com>
	<3086966.1740873261@sss.pgh.pa.us>
	<CACJufxFQkAwZ-VpFX4ZYHqi0PPL4RMfB4Zp=8At=oF-zgBX4yA@mail.gmail.com>
	<3519325.1740953319@sss.pgh.pa.us>
	<CACJufxE9Ey=M_gpDpXFwur5g+CcXv-ZM0aSZPc+SCk0MqngstA@mail.gmail.com>
	<3664075.1741018726@sss.pgh.pa.us>
	<4060266.1741027118@sss.pgh.pa.us>
	<025a3ffa-5eff-4a88-97fb-8f583b015965@gmail.com>

Alexander Lakhin <exclusion@gmail.com> writes:
> I've discovered that 95f650674 introduced a defect similar to bug #18297,
> but this time with DEFAULT. Namely, the following script:
> CREATE TABLE a (aa text);
> CREATE TABLE c (cc text) INHERITS (a);
> CREATE TABLE d (dd text) INHERITS (c, a);
> ALTER TABLE a ADD COLUMN i int DEFAULT 1;

> fails with:
> ERROR:  XX000: tuple already updated by self
> LOCATION:  simple_heap_update, heapam.c:4421

Hmm, yeah.  The failing call is here:

            /* Bump the existing child att's inhcount */
	    ...
            CatalogTupleUpdate(attrdesc, &tuple->t_self, tuple);

so I think you're right that that code path is now short a
CommandCounterIncrement() somewhere.  I'll look tomorrow if
nobody beats me to it.

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <706572.1743555948@sss.pgh.pa.us>
Permalink:  ../706572.1743555948@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/706572.1743555948@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, jian.universality@gmail.com
  Subject: Re: bug when apply fast default mechanism for adding new column over domain with default value
  In-Reply-To: <706572.1743555948@sss.pgh.pa.us>

* 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