Re: Add check constraint bug

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add check constraint bug
Date: 2002-09-06 00:44:05
Message-ID: 200209060044.g860i5h28529@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Is there a TODO here?

---------------------------------------------------------------------------

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > The following happens in latest CVS and a fresh database:
> > create table test (a int);
> > insert into test values (1);
> > alter table test add column b text check (b <> '');
>
> This bug's been there awhile I fear. The failure occurs when
> AlterTableAddColumn needs to add a check constraint AND the
> new column causes AlterTableCreateToastTable to do its thing.
>
> The reason there is a bug is that AlterTableCreateToastTable
> gratuitously does a heap_mark4update, thereby selecting the un-updated
> version of the pg_class tuple as its basis for modification (and
> ignoring the HeapTupleSelfUpdated return code that warned that there
> was a problem).
>
> I've said before that I do not like heap_mark4update in catalog
> manipulations, and here's a perfect example of why it's a bad idea.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-09-06 00:48:04 Re: I am done
Previous Message Gavin Sherry 2002-09-06 00:17:37 Re: I am done