Re: dropdb --force
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, vignesh C <vignesh21@gmail.com>, Ryan Lambert <ryan@rustprooflabs.com>, Tom Lane <tgl@sss.pgh.pa.us>, Thomas Munro <thomas.munro@gmail.com>, Anthony Nowocien <anowocien@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Filip Rembiałkowski <filip.rembialkowski@gmail.com>
Date: 2019-09-26T15:50:43Z
Lists: pgsql-hackers
Attachments
- drop-database-force-20190926-2.patch (text/x-patch) patch
čt 26. 9. 2019 v 17:35 odesílatel Alvaro Herrera <alvherre@2ndquadrant.com> napsal: > On 2019-Sep-26, Pavel Stehule wrote: > > > Alternative is DROP DATABASE [IF EXISTS] name [ CASCADE | RESTRICT ] [ > WITH > > FORCE ] > > > > but in this case WIDTH keyword should not be optional (If I need to solve > > Tom's note). Currently WITH keyword is optional every where, so I think > so > > using syntax with required WIDTH keyword is not happy. > > Well, you would have one of those: > > DROP DATABASE [IF EXISTS] name WITH (FORCE) > DROP DATABASE [IF EXISTS] name > > Naturally, the WITH is optional in the sense that the clause itself is > optional. (Note we don't have CASCADE/RESTRICT in DROP DATABASE.) > > You propose > > DROP DATABASE (FORCE) [IF EXISTS] name > > which seems weird to me -- I think only legacy syntax uses that form. > I have not strong opinion about it, little bit prefer option list after DROP DATABASE, because it is some what I know from EXPLAIN ANALYZE daily work, but it is not too important. Your proposed syntax is ok. Second patch implements Alvaro's proposed syntax. Pavel > -- > Álvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >
Commits
-
Add tests for '-f' option in dropdb utility.
- 8a7e9e9dad56 13.0 landed
-
Move pump_until to TestLib.pm.
- 290acac92b1d 13.0 landed
-
Add the support for '-f' option in dropdb utility.
- 80e05a088e4e 13.0 landed
-
Introduce the 'force' option for the Drop Database command.
- 1379fd537f9f 13.0 landed
-
Improve CREATE/DROP/RENAME DATABASE so that when failing because the source
- 4abd7b49f1e9 8.4.0 cited