Re: dropdb --force - Mailing list pgsql-hackers

From vignesh C
Subject Re: dropdb --force
Date
Msg-id CALDaNm04yQjvT=F9XkeCj=-D7pFx4iNacDbQDXxb=ACYfO62HA@mail.gmail.com
Whole thread Raw
In response to Re: dropdb --force  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: dropdb --force  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Fri, Nov 15, 2019 at 1:23 PM Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
> updated patch attached
>

Thanks Pavel  for providing updated version.
Few comments:
I felt the help text  seems incomplete:
@@ -159,6 +167,7 @@ help(const char *progname)
     printf(_("\nOptions:\n"));
     printf(_("  -e, --echo                show the commands being
sent to the server\n"));
     printf(_("  -i, --interactive         prompt before deleting anything\n"));
+    printf(_("  -f, --force               try to terminate other
connection before\n"));
     printf(_("  -V, --version             output version information,
then exit\n"));
we can change to:
printf(_("  -f, --force               try to terminate other
connection before dropping\n"));

We can add one test including -e option which validates the command
generation including WITH (FORCE):
+$node->safe_psql('postgres', 'CREATE DATABASE foobar2');
+$node->issues_sql_like(
+    [ 'dropdb', '--force', 'foobar2' ],
+    qr/statement: DROP DATABASE foobar2 WITH \(FORCE\);/,
+    'SQL DROP DATABASE (FORCE) run');
+

Also should we include one test where one session is connected to db
and another session tries dropping with -f option?

Regards,
Vignesh
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.
Next
From: Thomas Munro
Date:
Subject: Partial path row estimates