Re: Autovacuum improvements
Alvaro Herrera <alvherre@commandprompt.com>
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hackers <pgsql-hackers@postgresql.org>
Date: 2007-01-14T20:57:45Z
Lists: pgsql-hackers
Tom Lane wrote: > >> * contrib tests fail in their repeated drop/create database operations > >> because autovac is connected to that database. (pl tests presumably > >> have same issue.) > > The DROP is at risk, but CREATE is also at risk because autovac feels > free to connect to template0. (One of the reasons we invented template0 > was to prevent CREATE DATABASE failures due to someone-else-connected, > but autovac has broken that idea.) > > Possibly we could handle these by extending create/drop db to check > whether a process-connected-to-the-target-db is an autovac, and if so > send it a SIGINT and wait for the process to terminate, instead of > failing. Hmm, I can see having DROP DATABASE just stopping the autovacuum (since the work will be thrown away), but is a good idea to stop it on CREATE DATABASE? I think it may be better to have CREATE DATABASE wait until the vacuum is finished. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.