Re: pg_autovacuum causes 'create database' to fail when the

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_autovacuum causes 'create database' to fail when the
Date: 2003-11-08 16:24:06
Message-ID: 200311081624.hA8GO6J14116@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Good description --- not sure what we can do about it.

---------------------------------------------------------------------------

Frank van Vugt wrote:
> Hi,
>
> I noticed that when using the single commandline:
>
> drop database <name>; create database <name>;
>
> this sometimes fails due to a pg_autovacuum process running on the background.
>
>
> When this happens, the error returned is:
>
> db2=# drop database db1; create database db1;
> DROP DATABASE
> ERROR: source database "template1" is being accessed by other users
>
>
>
> The logs shows that pg_autovacuum kicks in right after the drop database, but
> right before the create database, causing the latter to fail:
>
>
> 2003-11-08 10:50:15 [1422] LOG: unexpected EOF on client connection
> 2003-11-08 10:50:46 [1424] LOG: connection received: host=<ip> port=<port>
> 2003-11-08 10:50:46 [1424] LOG: connection authorized: user=<my_name>
> database=db2
> 2003-11-08 10:50:52 [1424] LOG: query: drop database db1;
> 2003-11-08 10:50:55 [1426] LOG: connection received: host=[local] port=
> 2003-11-08 10:50:55 [1426] LOG: connection authorized:
> user=<pg_autovacuum_user> database=template1
> 2003-11-08 10:50:56 [1424] LOG: query: create database db1;
> 2003-11-08 10:50:56 [1424] ERROR: source database "template1" is being
> accessed by other users
>
>
> Obviously, simply reentering 'create database db1' corrects the problem ;-)
>
>
> db2=# select version();
> version
> ------------------------------------------------------------------
> PostgreSQL 7.4beta3 on i586-pc-linux-gnu, compiled by GCC 2.95.3
> (1 row)
>
>
> pg_autovacuum is started using the options '-D -d2'
>
>
>
>
> This may very well be expected behaviour, but I didn't find anything on it in
> pg_autovacuum's README or TODO, so just in case it is a bug.......
>
>
>
>
> --
> Best,
>
>
>
>
> Frank van Vugt
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message monu agrawal 2003-11-08 16:38:38 performance: time & disk access measurment
Previous Message Arturo Perez 2003-11-08 16:05:12 Re: PostgreSQL, Postgre and Apple