Re: dropdb --force

2019-09-17 Thread Pavel Stehule
st 18. 9. 2019 v 4:57 odesílatel Pavel Stehule napsal: > > > st 18. 9. 2019 v 4:53 odesílatel Ryan Lambert > napsal: > >> Hi Pavel, >> I took a quick look through the patch, I'll try to build and test it >> tomorrow. >> >> >> --- a/src/include/nodes/parsenodes.h >> +++

Re: dropdb --force

2019-09-17 Thread Pavel Stehule
st 18. 9. 2019 v 4:53 odesílatel Ryan Lambert napsal: > Hi Pavel, > I took a quick look through the patch, I'll try to build and test it > tomorrow. > > > --- a/src/include/nodes/parsenodes.h > +++ b/src/include/nodes/parsenodes.h > @@ -3145,6 +3145,7 @@ typedef struct DropdbStmt > NodeTag type;

Re: dropdb --force

2019-09-17 Thread Ryan Lambert
Hi Pavel, I took a quick look through the patch, I'll try to build and test it tomorrow. --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -3145,6 +3145,7 @@ typedef struct DropdbStmt NodeTag type; char *dbname; /* database to drop */ bool missing_ok; /* skip error

Re: dropdb --force

2019-09-17 Thread Pavel Stehule
Hi I started work on this patch. I changed syntax to DROP DATABASE [ ( FORCE , ..) ] [IF EXISTS ...] and now I try to fix all other points from Tom's list út 17. 9. 2019 v 12:15 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > [ drop-database-force-20190708.patch ] > > I took a brief

Re: dropdb --force

2019-09-03 Thread Pavel Stehule
út 3. 9. 2019 v 18:46 odesílatel Alvaro Herrera napsal: > On 2019-Jul-25, Pavel Stehule wrote: > > > čt 25. 7. 2019 v 5:11 odesílatel Tom Lane napsal: > > > > > Pavel Stehule writes: > > > > * I'm concerned that the proposed syntax is not future-proof. > > > > Can be > > > > DROP DATABASE '('

Re: dropdb --force

2019-09-03 Thread Alvaro Herrera
On 2019-Jul-25, Pavel Stehule wrote: > čt 25. 7. 2019 v 5:11 odesílatel Tom Lane napsal: > > > Pavel Stehule writes: > > * I'm concerned that the proposed syntax is not future-proof. > > Can be > > DROP DATABASE '(' options ...) [IF EXISTS] name > > ok? Seems weird to me. I'd rather have

Re: dropdb --force

2019-08-06 Thread Ryan Lambert
I set the status to Waiting on Author since Tom's concerns [1] have not been addressed. [1] https://www.postgresql.org/message-id/15707.1564024305%40sss.pgh.pa.us Thanks, Ryan

Re: dropdb --force

2019-08-01 Thread Thomas Munro
On Thu, Jul 25, 2019 at 8:45 PM Pavel Stehule wrote: > čt 25. 7. 2019 v 5:11 odesílatel Tom Lane napsal: >> Pavel Stehule writes: >> > [ drop-database-force-20190708.patch ] >> >> I took a brief look at this, but I don't think it's really close to >> being committable. Hi Pavel, The concept

Re: dropdb --force

2019-07-25 Thread Pavel Stehule
čt 25. 7. 2019 v 5:11 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > [ drop-database-force-20190708.patch ] > > I took a brief look at this, but I don't think it's really close to > being committable. > > * The documentation claims FORCE will fail if you don't have privileges > to

Re: dropdb --force

2019-07-24 Thread Tom Lane
Pavel Stehule writes: > [ drop-database-force-20190708.patch ] I took a brief look at this, but I don't think it's really close to being committable. * The documentation claims FORCE will fail if you don't have privileges to terminate the other session(s) in the target DB. This is a lie; the

Re: dropdb --force

2019-07-17 Thread Ryan Lambert
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested Hi, The latest patch [1] applies cleanly and basic functionality

Re: dropdb --force

2019-07-08 Thread Pavel Stehule
po 8. 7. 2019 v 0:07 odesílatel Thomas Munro napsal: > On Thu, Jun 27, 2019 at 7:15 AM Pavel Stehule > wrote: > > fixed > > Hi Pavel, > > FYI t/050_dropdb.pl fails consistently with this patch applied: > > https://travis-ci.org/postgresql-cfbot/postgresql/builds/555234838 with attached patch

Re: dropdb --force

2019-07-07 Thread Thomas Munro
On Thu, Jun 27, 2019 at 7:15 AM Pavel Stehule wrote: > fixed Hi Pavel, FYI t/050_dropdb.pl fails consistently with this patch applied: https://travis-ci.org/postgresql-cfbot/postgresql/builds/555234838 -- Thomas Munro https://enterprisedb.com

Re: dropdb --force

2019-06-26 Thread Pavel Stehule
Hi po 24. 6. 2019 v 10:28 odesílatel Anthony Nowocien napsal: > Hi, > patch no longer applies (as of 12beta2). > > postgres@ubuntudev:~/pg_testing/source/postgresql-12beta2$ patch -p1 < > drop-database-force-20190310_01.patch > patching file doc/src/sgml/ref/drop_database.sgml > patching file

Re: dropdb --force

2019-06-24 Thread Anthony Nowocien
Hi, patch no longer applies (as of 12beta2). postgres@ubuntudev:~/pg_testing/source/postgresql-12beta2$ patch -p1 < drop-database-force-20190310_01.patch patching file doc/src/sgml/ref/drop_database.sgml patching file doc/src/sgml/ref/dropdb.sgml patching file src/backend/commands/dbcommands.c

Re: dropdb --force

2019-05-16 Thread Anthony Nowocien
Also works fine according to my testing. Documentation is also clear. Thanks for this useful patch.

Re: dropdb --force

2019-04-09 Thread Ibrar Ahmed
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested The feature works fine on my machine. The code is well-written.

Re: dropdb --force

2019-04-09 Thread Ibrar Ahmed
Yes, I think it is because of this code Snippet if (force_terminate) { /* try to terminate backend */ #ifdef HAVE_SETSID kill(-(proc->pid), SIGTERM); #else kill(proc->pid,

Re: dropdb --force

2019-04-09 Thread Ibrar Ahmed
Is this the intended behavior? SIGTERM is received. test=# begin; BEGIN test=# create table test(a int); CREATE TABLE In another terminal drop the database. test=# begin; psql: FATAL: terminating connection due to administrator command server closed the connection unexpectedly This

Re: dropdb --force

2019-04-01 Thread Filip Rembiałkowski
On 31.03.2019, 04:35 Andres Freund wrote: > > > bool > > -CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared) > > +CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared, bool > > force_terminate) > > { > > That doesn't seem like a decent API to me. Only excuse

Re: dropdb --force

2019-03-30 Thread Andres Freund
Hi, On 2019-03-10 11:20:42 +0100, Filip Rembiałkowski wrote: > bool > -CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared) > +CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared, bool > force_terminate) > { That doesn't seem like a decent API to me.

Re: dropdb --force

2019-03-30 Thread Ryan Lambert
Hello, This is a feature I have wanted for a long time, thank you for your work on this. The latest patch [1] applied cleanly for me. In dbcommands.c the comment references a 5 second delay, I don't see where that happens, am I missing something? I tested both the dropdb program and the in

Re: dropdb --force

2019-03-10 Thread Filip Rembiałkowski
Thank you. Updated patch attached. On Sat, Mar 9, 2019 at 2:53 AM Thomas Munro wrote: > > On Wed, Mar 6, 2019 at 1:39 PM Filip Rembiałkowski > wrote: > > Here is Pavel's patch rebased to master branch, added the dropdb > > --force option, a test case & documentation. > > Hello, > >

Re: dropdb --force

2019-03-08 Thread Thomas Munro
On Wed, Mar 6, 2019 at 1:39 PM Filip Rembiałkowski wrote: > Here is Pavel's patch rebased to master branch, added the dropdb > --force option, a test case & documentation. Hello, cfbot.cputube.org says this fails on Windows, due to a missing semicolon here: #ifdef HAVE_SETSID

Re: dropdb --force

2019-03-05 Thread Filip Rembiałkowski
Here is Pavel's patch rebased to master branch, added the dropdb --force option, a test case & documentation. I'm willing to work on it if needed. What are possible bad things that could happen here? Is the documentation clear enough? Thanks. On Tue, Dec 18, 2018 at 4:34 PM Marti Raudsepp

Re: dropdb --force

2018-12-19 Thread Alvaro Herrera
I wonder if this idea from seven years ago might be useful: https://postgr.es/m/1305688547-sup-7...@alvh.no-ip.org -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: dropdb --force

2018-12-18 Thread Tom Lane
Marti Raudsepp writes: > I think Filip's approach of setting pg_database.datallowconn='false' > is pretty clever to avoid the synchronization problem. Some bull-in-a-china-shop has recently added logic that allows ignoring datallowconn and connecting anyway, so I'm not sure that that'd provide a

Re: dropdb --force

2018-12-18 Thread David Fetter
On Tue, Dec 18, 2018 at 01:25:32PM +0100, Filip Rembiałkowski wrote: > Hi, > > I propose a simple patch (works-for-me), which adds --force (-f) > option to dropdb utility. Nice! I did something like this in user space back in 2010.

Re: dropdb --force

2018-12-18 Thread Marti Raudsepp
Hi > út 18. 12. 2018 v 16:11 odesílatel Filip Rembiałkowski > napsal: >> Please share opinions if this makes sense at all, and has any chance >> going upstream. Clearly since Pavel has another implementation of the same concept, there is some interest in this feature. :) On Tue, Dec 18, 2018

Re: dropdb --force

2018-12-18 Thread Pavel Stehule
Hi út 18. 12. 2018 v 16:11 odesílatel Filip Rembiałkowski < filip.rembialkow...@gmail.com> napsal: > Hi, > > I propose a simple patch (works-for-me), which adds --force (-f) > option to dropdb utility. > > Pros: This seems to be a desired option for many sysadmins, as this > thread proves: >

<    1   2