Re: dropdb --force
От | Pavel Stehule |
---|---|
Тема | Re: dropdb --force |
Дата | |
Msg-id | CAFj8pRCQjzi9VHAe9zCv2XJY=fe+U6nyzqZjH=a-67GJ=fi6Jw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: dropdb --force (vignesh C <vignesh21@gmail.com>) |
Ответы |
Re: dropdb --force
|
Список | pgsql-hackers |
so 16. 11. 2019 v 1:10 odesílatel vignesh C <vignesh21@gmail.com> napsal:
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"));
done. maybe alternative can be "first try to terminate other connections". It is shorter. The current text has 78 chars, what should be acceptable
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');
+
I don't understand to this point. It is effectively same like existing test
Also should we include one test where one session is connected to db
and another session tries dropping with -f option?
I afraid so test API doesn't allow asynchronous operations. Do you have any idea, how to it?
Regards
Pavel
Regards,
Vignesh
EnterpriseDB: http://www.enterprisedb.com
Вложения
В списке pgsql-hackers по дате отправления: