Re: COPY FREEZE has no warning - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: COPY FREEZE has no warning
Date
Msg-id 20130126183407.GD9274@momjian.us
Whole thread Raw
In response to Re: COPY FREEZE has no warning  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Fri, Jan 25, 2013 at 11:28:58PM -0500, Bruce Momjian wrote:
> On Fri, Jan 25, 2013 at 11:08:56PM -0500, Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.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

Patch applied.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: [BUGS] BUG #7515: DROP TABLE IF EXISTS fails if schema does not exist
Next
From: Pavel Stehule
Date:
Subject: Re: plpgsql_check_function - rebase for 9.3