Re: proposal: DROP DATABASE variant that kills active sessions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: DROP DATABASE variant that kills active sessions
Date: 2015-10-16 10:22:22
Message-ID: CAFj8pRBE3iwaO5W5oxXTUvrdsVSKrapSusJg6vi=Ah6E8YmZbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2015-10-16 12:13 GMT+02:00 Filip Rembiałkowski <
filip(dot)rembialkowski(at)gmail(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-10-16 11:42:30 Re: Parallel Seq Scan
Previous Message Filip Rembiałkowski 2015-10-16 10:13:21 proposal: DROP DATABASE variant that kills active sessions