Re: COPY FREEZE has no warning

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY FREEZE has no warning
Date: 2013-02-02 15:12:54
Message-ID: 20130202151254.GD2371@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 2, 2013 at 09:51:13AM -0500, Noah Misch wrote:
> > OK, so, should we change the error message:
> >
> > cannot perform FREEZE because of transaction activity after table
> > creation or truncation
> >
> > to
> >
> > cannot perform FREEZE because the table was not created or
> > truncated in the current subtransaction
> >
> > or do we need to keep the "transaction activity" weasel wording because
> > of the second case you listed above? I am suspecting the later.
>
> Let's touch on the exception in passing by using the phrase "last truncated",
> giving this wording for both the second and the third COPY FREEZE error sites:
>
> cannot perform FREEZE because the table was not created or last
> truncated in the current subtransaction

Well, so you are saying that there really isn't any use-visible logic
for those messages to be different, i.e. that the transaction id can be
set to invalid even if we created/truncated in the same transaction, but
not the same subtransaction?

The comparisons that trigger the two messages are:

if (cstate->rel->rd_createSubid != InvalidSubTransactionId ||
cstate->rel->rd_newRelfilenodeSubid != InvalidSubTransactionId)

and
if (cstate->rel->rd_createSubid != GetCurrentSubTransactionId() ||
cstate->rel->rd_newRelfilenodeSubid != GetCurrentSubTransactionId())

The first comparison is creation, the second, truncation.

Please confirm and I will make the change, or you can.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vlad Bailescu 2013-02-02 15:19:49 Re: Turning auto-analyze off (was Re: [GENERAL] Unusually high IO for autovacuum worker)
Previous Message Noah Misch 2013-02-02 14:51:13 Re: COPY FREEZE has no warning