Re: autocommit vs TRUNCATE et al

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: autocommit vs TRUNCATE et al
Date: 2002-10-22 05:38:01
Message-ID: 15638.1035265081@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> 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?

Well, the *best* alternative would be to make CREATE/DROP DATABASE
transaction-safe ;-). I was speculating to myself earlier today about
how we might do that. It seems like it's not that far out of reach:
we could make smgr's list of files-to-remove-at-xact-commit-or-abort
include whole database subdirectories. But I'm not sure how that would
interact with upcoming features like tablespaces, so I don't want to
go off and implement it right now.

In the meantime, to tell you the truth, the cleanest way to handle the
dblink regression test would be to make it circularly connect to
database "regression". I know this seems cheesy, but as long as the
software under test doesn't know that it's a connection-to-self, seems
like the test is perfectly good. And it's surely easier to manage that
way.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2002-10-22 06:02:48 Re: autocommit vs TRUNCATE et al
Previous Message Joe Conway 2002-10-22 05:25:42 Re: autocommit vs TRUNCATE et al