Re: autocommit vs TRUNCATE et al

From: Joe Conway <mail(at)joeconway(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>, Tom Lane <tgl(at)postgresql(dot)org>
Subject: Re: autocommit vs TRUNCATE et al
Date: 2002-10-22 05:25:42
Message-ID: 3DB4E156.8090701@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> We can go with the auto-COMMIT idea for statements that are invoked at
> the outer interactive level, but that doesn't work for stuff invoked
> inside a function. I think we need to forbid these statements inside
> functions, too. We already have that for VACUUM, because of its
> internal commits causing problems for functions, but we'll need to
> extend it to all of them.
>
> Just FYI, the statements involved are
> VACUUM
> TRUNCATE TABLE
> CREATE/DROP DATABASE

I just noticed that this afternoon's changes cause dblink's regression test to
fail due to:

CREATE OR REPLACE FUNCTION conditional_drop()
[...]
IF FOUND THEN
DROP DATABASE regression_slave;
END IF;
[...]
' LANGUAGE 'plpgsql';
SELECT conditional_drop();

I'm wondering what is the best alternative? Should we simply do a "DROP
DATABASE regression_slave;" and have the expected results include the
'database "regression_slave" does not exist'? In this case there would be an
expected failure whenever the regression test was run more than once.

Joe

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-10-22 05:38:01 Re: autocommit vs TRUNCATE et al
Previous Message Alvaro Herrera 2002-10-22 03:12:30 BTree free pages again