Re: dropdb --force

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>, Ryan Lambert <ryan@rustprooflabs.com>, Tom Lane <tgl@sss.pgh.pa.us>, Anthony Nowocien <anowocien@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Filip Rembiałkowski <filip.rembialkowski@gmail.com>
Date: 2019-09-20T03:10:07Z
Lists: pgsql-hackers
On Thu, Sep 19, 2019 at 6:44 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:
> I am sending updated version

+    appendPQExpBuffer(&sql, "DROP DATABASE %s%s%s;",
+                      (force ? " (FORCE) " : ""),

An extra space before (FORCE) caused the test to fail:

# 2019-09-19 19:07:22.203 UTC [1516] 050_dropdb.pl LOG: statement:
DROP DATABASE (FORCE) foobar2;

#     doesn't match '(?^:statement: DROP DATABASE (FORCE) foobar2)'

-- 
Thomas Munro
https://enterprisedb.com



Commits

  1. Add tests for '-f' option in dropdb utility.

  2. Move pump_until to TestLib.pm.

  3. Add the support for '-f' option in dropdb utility.

  4. Introduce the 'force' option for the Drop Database command.

  5. Improve CREATE/DROP/RENAME DATABASE so that when failing because the source