Re: proposal: DROP DATABASE variant that kills active sessions - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: DROP DATABASE variant that kills active sessions
Date
Msg-id CAFj8pRBE3iwaO5W5oxXTUvrdsVSKrapSusJg6vi=Ah6E8YmZbA@mail.gmail.com
Whole thread Raw
In response to proposal: DROP DATABASE variant that kills active sessions  (Filip Rembiałkowski <filip.rembialkowski@gmail.com>)
Responses Re: proposal: DROP DATABASE variant that kills active sessions  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi

2015-10-16 12:13 GMT+02:00 Filip Rembiałkowski <filip.rembialkowski@gmail.com>:
DROP DATABASE mydb CONCURRENTLY;

That would perform forced shutdown

1) reject any new backends to mydb
2) terminate old backends
3) drop db

40 upvotes here http://dba.stackexchange.com/a/11895/3710 inspired me
to propose this improvement.

If you think it's a good idea please include it as a low-priority TODO item.

in GoodData we have this feature implemented - little bit different named - DROP DATABASE FORCE

It is useful in complex environment with mix of pooled and not pooled connections - and in our environment - about 2K databases per server with lot of dropped / created databases per server / per day.

I can publish this patch, if there will be any interest.

last note: little bit related topic - we have some patches for CREATE DATABASE - longer waiting for locking template1 - although there are some opened issues - like any CREATE DATABASE requires checkpoint, and it is slower in our environment.

Regards

Pavel


 

thanks


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Filip Rembiałkowski
Date:
Subject: proposal: DROP DATABASE variant that kills active sessions
Next
From: Amit Kapila
Date:
Subject: Re: Parallel Seq Scan