Re: COPY FREEZE has no warning

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-01-26 04:28:58
Message-ID: 20130126042858.GB9274@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 25, 2013 at 11:08:56PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > ! ereport(ERROR,
> > ! (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,
> > ! errmsg("cannot perform FREEZE because of previous table activity in the current transaction")));
>
> [ itch... ] What is "table activity"? I always thought of tables as
> being rather passive objects. And anyway, isn't this backwards? What
> we're complaining of is *lack* of activity. I don't see why this isn't
> using the same message as the other code path, namely

Well, here is an example of this message:

BEGIN;
TRUNCATE vistest;
SAVEPOINT s1;
COPY vistest FROM stdin CSV FREEZE;
ERROR: cannot perform FREEZE because of previous table activity in the current transaction
COMMIT;

Clearly it was truncated in the same transaction, but the savepoint
somehow invalidates the freeze. There is a C comment about it:

* BEGIN;
* TRUNCATE t;
* SAVEPOINT save;
* TRUNCATE t;
* ROLLBACK TO save;
* COPY ...

I changed it to:

ERROR: cannot perform FREEZE because of transaction activity after table creation or truncation

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

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

Attachment Content-Type Size
freeze3.diff text/x-diff 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2013-01-26 05:24:39 Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Previous Message Craig Ringer 2013-01-26 04:20:56 Re: Visual Studio 2012 RC