Re: dropdb --force

2020-01-31 Thread Amit Kapila
On Sat, Nov 30, 2019 at 7:46 AM Michael Paquier wrote: > > On Fri, Nov 29, 2019 at 03:31:21PM +0530, Amit Kapila wrote: > > It might be better to move it to next CF as the discussion is still active. > > OK, just did that. > I have marked this as committed in CF. This was committed some time

Re: dropdb --force

2019-11-29 Thread Michael Paquier
On Fri, Nov 29, 2019 at 03:31:21PM +0530, Amit Kapila wrote: > It might be better to move it to next CF as the discussion is still active. OK, just did that. -- Michael signature.asc Description: PGP signature

Re: dropdb --force

2019-11-29 Thread vignesh C
On Fri, Nov 29, 2019 at 1:36 PM Juan José Santamaría Flecha wrote: > > > > On Fri, Nov 29, 2019 at 7:30 AM Michael Paquier wrote: >> >> On Thu, Nov 28, 2019 at 08:53:56AM +0530, Amit Kapila wrote: >> > I have pushed the refactoring patch. In the second patch, I have a >> > few more comments. I

Re: dropdb --force

2019-11-29 Thread Amit Kapila
On Fri, Nov 29, 2019 at 1:36 PM Juan José Santamaría Flecha wrote: > > > On Fri, Nov 29, 2019 at 7:30 AM Michael Paquier wrote: >> >> On Thu, Nov 28, 2019 at 08:53:56AM +0530, Amit Kapila wrote: >> > I have pushed the refactoring patch. In the second patch, I have a >> > few more comments. I

Re: dropdb --force

2019-11-29 Thread Juan José Santamaría Flecha
On Fri, Nov 29, 2019 at 7:30 AM Michael Paquier wrote: > On Thu, Nov 28, 2019 at 08:53:56AM +0530, Amit Kapila wrote: > > I have pushed the refactoring patch. In the second patch, I have a > > few more comments. I am not completely sure if it is a good idea to > > write a new test file

Re: dropdb --force

2019-11-28 Thread Michael Paquier
On Thu, Nov 28, 2019 at 08:53:56AM +0530, Amit Kapila wrote: > I have pushed the refactoring patch. In the second patch, I have a > few more comments. I am not completely sure if it is a good idea to > write a new test file 060_dropdb_force.pl when we already have an > existing file

Re: dropdb --force

2019-11-27 Thread vignesh C
On Thu, Nov 28, 2019 at 8:54 AM Amit Kapila wrote: > > On Wed, Nov 27, 2019 at 10:15 AM vignesh C wrote: > > > > > > Attached patch has the fixes for the above comments. > > > > I have pushed the refactoring patch. In the second patch, I have a > few more comments. I am not completely sure if

Re: dropdb --force

2019-11-27 Thread Amit Kapila
On Wed, Nov 27, 2019 at 10:15 AM vignesh C wrote: > > > Attached patch has the fixes for the above comments. > I have pushed the refactoring patch. In the second patch, I have a few more comments. I am not completely sure if it is a good idea to write a new test file 060_dropdb_force.pl when

Re: dropdb --force

2019-11-26 Thread vignesh C
On Tue, Nov 26, 2019 at 11:37 AM Amit Kapila wrote: > > On Mon, Nov 25, 2019 at 11:22 PM vignesh C wrote: > > > > On Sun, Nov 24, 2019 at 5:06 PM Pavel Stehule > > wrote: > > > > > > > > > > > > ne 24. 11. 2019 v 11:25 odesílatel vignesh C napsal: > > >> > > >> On Sat, Nov 23, 2019 at 4:42 PM

Re: dropdb --force

2019-11-25 Thread Amit Kapila
On Mon, Nov 25, 2019 at 11:22 PM vignesh C wrote: > > On Sun, Nov 24, 2019 at 5:06 PM Pavel Stehule wrote: > > > > > > > > ne 24. 11. 2019 v 11:25 odesílatel vignesh C napsal: > >> > >> On Sat, Nov 23, 2019 at 4:42 PM Amit Kapila > >> wrote: > >> > > >> > On Fri, Nov 22, 2019 at 3:16 PM

Re: dropdb --force

2019-11-25 Thread vignesh C
On Sun, Nov 24, 2019 at 5:06 PM Pavel Stehule wrote: > > > > ne 24. 11. 2019 v 11:25 odesílatel vignesh C napsal: >> >> On Sat, Nov 23, 2019 at 4:42 PM Amit Kapila wrote: >> > >> > On Fri, Nov 22, 2019 at 3:16 PM vignesh C wrote: >> > > >> > > Thanks for fixing the comments. The changes looks

Re: dropdb --force

2019-11-25 Thread Amit Kapila
On Sun, Nov 24, 2019 at 3:55 PM vignesh C wrote: > > On Sat, Nov 23, 2019 at 4:42 PM Amit Kapila wrote: > > > > > 2. > > ok( TestLib::pump_until( > > + $killme, > > + $psql_timeout, > > + \$killme_stderr, > > + qr/FATAL: terminating connection due to administrator command/m > > + ), > > + "psql

Re: dropdb --force

2019-11-24 Thread Pavel Stehule
ne 24. 11. 2019 v 11:25 odesílatel vignesh C napsal: > On Sat, Nov 23, 2019 at 4:42 PM Amit Kapila > wrote: > > > > On Fri, Nov 22, 2019 at 3:16 PM vignesh C wrote: > > > > > > Thanks for fixing the comments. The changes looks fine to me. I have > > > fixed the first comment, attached patch

Re: dropdb --force

2019-11-24 Thread vignesh C
On Sat, Nov 23, 2019 at 4:42 PM Amit Kapila wrote: > > On Fri, Nov 22, 2019 at 3:16 PM vignesh C wrote: > > > > Thanks for fixing the comments. The changes looks fine to me. I have > > fixed the first comment, attached patch has the changes for the same. > > > > Few comments: >

Re: dropdb --force

2019-11-23 Thread Amit Kapila
On Fri, Nov 22, 2019 at 3:16 PM vignesh C wrote: > > Thanks for fixing the comments. The changes looks fine to me. I have > fixed the first comment, attached patch has the changes for the same. > Few comments: -- 1. There is a lot of duplicate code in this test.

Re: dropdb --force

2019-11-22 Thread Pavel Stehule
pá 22. 11. 2019 v 10:46 odesílatel vignesh C napsal: > On Fri, Nov 22, 2019 at 12:10 AM Pavel Stehule > wrote: > > > > > > > > čt 21. 11. 2019 v 6:33 odesílatel vignesh C > napsal: > >> > >> On Mon, Nov 18, 2019 at 6:30 PM Pavel Stehule > wrote: > >> >> > >> >> I'll send this test today > >>

Re: dropdb --force

2019-11-22 Thread vignesh C
On Fri, Nov 22, 2019 at 12:10 AM Pavel Stehule wrote: > > > > čt 21. 11. 2019 v 6:33 odesílatel vignesh C napsal: >> >> On Mon, Nov 18, 2019 at 6:30 PM Pavel Stehule >> wrote: >> >> >> >> I'll send this test today >> > >> > >> > here is it >> > >> >> Thanks for adding the test. >> Few

Re: dropdb --force

2019-11-21 Thread Pavel Stehule
čt 21. 11. 2019 v 6:33 odesílatel vignesh C napsal: > On Mon, Nov 18, 2019 at 6:30 PM Pavel Stehule > wrote: > >> > >> I'll send this test today > > > > > > here is it > > > > Thanks for adding the test. > Few comments: > This function is same as in test/recovery/t/013_crash_restart.pl, we >

Re: dropdb --force

2019-11-20 Thread vignesh C
On Mon, Nov 18, 2019 at 6:30 PM Pavel Stehule wrote: >> >> I'll send this test today > > > here is it > Thanks for adding the test. Few comments: This function is same as in test/recovery/t/013_crash_restart.pl, we can add to a common file and use in both places: +# Pump until string is matched,

Re: dropdb --force

2019-11-20 Thread Pavel Stehule
st 20. 11. 2019 v 12:40 odesílatel Amit Kapila napsal: > On Mon, Nov 18, 2019 at 10:59 AM Pavel Stehule > wrote: > > po 18. 11. 2019 v 6:24 odesílatel Amit Kapila > napsal: > >> > >> > >> I have slightly modified the main patch and attached is the result. > >> Basically, I don't see any need

Re: dropdb --force

2019-11-20 Thread Amit Kapila
On Mon, Nov 18, 2019 at 10:59 AM Pavel Stehule wrote: > po 18. 11. 2019 v 6:24 odesílatel Amit Kapila > napsal: >> >> >> I have slightly modified the main patch and attached is the result. >> Basically, I don't see any need to repeat what is mentioned in the >> Drop Database page. Let me know

Re: dropdb --force

2019-11-18 Thread Pavel Stehule
po 18. 11. 2019 v 7:39 odesílatel Pavel Stehule napsal: > > > po 18. 11. 2019 v 7:37 odesílatel Amit Kapila > napsal: > >> On Mon, Nov 18, 2019 at 10:59 AM Pavel Stehule >> wrote: >> > po 18. 11. 2019 v 6:24 odesílatel Amit Kapila >> napsal: >> >> >> >> On Mon, Nov 18, 2019 at 10:33 AM Pavel

Re: dropdb --force

2019-11-17 Thread Pavel Stehule
po 18. 11. 2019 v 7:37 odesílatel Amit Kapila napsal: > On Mon, Nov 18, 2019 at 10:59 AM Pavel Stehule > wrote: > > po 18. 11. 2019 v 6:24 odesílatel Amit Kapila > napsal: > >> > >> On Mon, Nov 18, 2019 at 10:33 AM Pavel Stehule > wrote: > >> > > >> > po 18. 11. 2019 v 4:43 odesílatel vignesh

Re: dropdb --force

2019-11-17 Thread Amit Kapila
On Mon, Nov 18, 2019 at 10:59 AM Pavel Stehule wrote: > po 18. 11. 2019 v 6:24 odesílatel Amit Kapila > napsal: >> >> On Mon, Nov 18, 2019 at 10:33 AM Pavel Stehule >> wrote: >> > >> > po 18. 11. 2019 v 4:43 odesílatel vignesh C napsal: >> >> >> >> >> >> I had seen that isolation

Re: dropdb --force

2019-11-17 Thread Pavel Stehule
po 18. 11. 2019 v 6:24 odesílatel Amit Kapila napsal: > On Mon, Nov 18, 2019 at 10:33 AM Pavel Stehule > wrote: > > > > po 18. 11. 2019 v 4:43 odesílatel vignesh C > napsal: > >> > >> > >> When we don't specify -e option, the query used to drop db will not be > >> printed like below: > >>

Re: dropdb --force

2019-11-17 Thread Amit Kapila
On Mon, Nov 18, 2019 at 10:33 AM Pavel Stehule wrote: > > po 18. 11. 2019 v 4:43 odesílatel vignesh C napsal: >> >> >> When we don't specify -e option, the query used to drop db will not be >> printed like below: >> ./dropdb testdb1 >> When we specify -e option, the query used to drop db will be

Re: dropdb --force

2019-11-17 Thread Pavel Stehule
po 18. 11. 2019 v 4:43 odesílatel vignesh C napsal: > On Sat, Nov 16, 2019 at 1:25 PM Pavel Stehule > wrote: > >> > > >> > updated patch attached > >> > > >> > >> Thanks Pavel for providing updated version. > >> Few comments: > >> I felt the help text seems incomplete: > >> @@ -159,6 +167,7

Re: dropdb --force

2019-11-17 Thread vignesh C
On Sat, Nov 16, 2019 at 1:25 PM Pavel Stehule 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")); >>

Re: dropdb --force

2019-11-15 Thread Pavel Stehule
so 16. 11. 2019 v 1:10 odesílatel vignesh C napsal: > On Fri, Nov 15, 2019 at 1:23 PM Pavel Stehule > 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

Re: dropdb --force

2019-11-15 Thread vignesh C
On Fri, Nov 15, 2019 at 1:23 PM Pavel Stehule 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

Re: dropdb --force

2019-11-14 Thread Pavel Stehule
čt 14. 11. 2019 v 12:12 odesílatel vignesh C napsal: > On Wed, Nov 13, 2019 at 8:05 PM Pavel Stehule > wrote: > > > > > > > > st 13. 11. 2019 v 7:13 odesílatel Pavel Stehule > napsal: > >> > >> > >> > >> st 13. 11. 2019 v 7:12 odesílatel Amit Kapila > napsal: > >>> > >>> On Tue, Nov 12, 2019

Re: dropdb --force

2019-11-14 Thread vignesh C
On Wed, Nov 13, 2019 at 8:05 PM Pavel Stehule wrote: > > > > st 13. 11. 2019 v 7:13 odesílatel Pavel Stehule > napsal: >> >> >> >> st 13. 11. 2019 v 7:12 odesílatel Amit Kapila >> napsal: >>> >>> On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila >>> wrote: >>> > >>> > I am planning to commit

Re: dropdb --force

2019-11-13 Thread Pavel Stehule
čt 14. 11. 2019 v 7:44 odesílatel Amit Kapila napsal: > On Thu, Nov 14, 2019 at 11:43 AM Pavel Stehule > wrote: > > > > st 13. 11. 2019 v 15:34 odesílatel Pavel Stehule < > pavel.steh...@gmail.com> napsal: > >> > >> > >> here it is. It's based on Filip Rembialkowski's patch if I remember >

Re: dropdb --force

2019-11-13 Thread Amit Kapila
On Thu, Nov 14, 2019 at 12:14 PM Amit Kapila wrote: > > On Thu, Nov 14, 2019 at 11:43 AM Pavel Stehule > wrote: > > > > st 13. 11. 2019 v 15:34 odesílatel Pavel Stehule > > napsal: > >> > >> > >> here it is. It's based on Filip Rembialkowski's patch if I remember > >> correctly > > > > > >

Re: dropdb --force

2019-11-13 Thread Amit Kapila
On Thu, Nov 14, 2019 at 11:43 AM Pavel Stehule wrote: > > st 13. 11. 2019 v 15:34 odesílatel Pavel Stehule > napsal: >> >> >> here it is. It's based on Filip Rembialkowski's patch if I remember correctly > > > have I this patch assign to next commitfest or you process it in this > commitfest?

Re: dropdb --force

2019-11-13 Thread Pavel Stehule
st 13. 11. 2019 v 15:34 odesílatel Pavel Stehule napsal: > > > st 13. 11. 2019 v 7:13 odesílatel Pavel Stehule > napsal: > >> >> >> st 13. 11. 2019 v 7:12 odesílatel Amit Kapila >> napsal: >> >>> On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila >>> wrote: >>> > >>> > I am planning to commit this

Re: dropdb --force

2019-11-13 Thread Pavel Stehule
st 13. 11. 2019 v 7:13 odesílatel Pavel Stehule napsal: > > > st 13. 11. 2019 v 7:12 odesílatel Amit Kapila > napsal: > >> On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila >> wrote: >> > >> > I am planning to commit this patch tomorrow unless I see more comments >> > or interest from someone else

Re: dropdb --force

2019-11-12 Thread Pavel Stehule
st 13. 11. 2019 v 7:12 odesílatel Amit Kapila napsal: > On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila > wrote: > > > > I am planning to commit this patch tomorrow unless I see more comments > > or interest from someone else to review this. > > > > Pushed. Pavel, feel free to submit dropdb

Re: dropdb --force

2019-11-12 Thread Amit Kapila
On Tue, Nov 12, 2019 at 11:17 AM Amit Kapila wrote: > > I am planning to commit this patch tomorrow unless I see more comments > or interest from someone else to review this. > Pushed. Pavel, feel free to submit dropdb utility-related patch if you want. -- With Regards, Amit Kapila.

Re: dropdb --force

2019-11-11 Thread Amit Kapila
On Mon, Nov 11, 2019 at 1:57 PM Amit Kapila wrote: > > This patch adds a few test cases to test the syntax in > /src/test/regress/sql/drop_if_exists.sql which I think is not the best > place to add the tests for this feature as it is primarily testing .. > IF EXISTS .. syntax. OTOH, I am not

Re: dropdb --force

2019-11-11 Thread Amit Kapila
On Mon, Nov 11, 2019 at 8:45 AM Amit Kapila wrote: > > On Fri, Nov 8, 2019 at 4:57 PM Pavel Stehule wrote: > > > > I check it now - it has sense. the described switch can protect users > > against useless client killing. > > > > I have committed that patch. Please find the rebased patch

Re: dropdb --force

2019-11-10 Thread Amit Kapila
On Fri, Nov 8, 2019 at 4:57 PM Pavel Stehule wrote: > > pá 8. 11. 2019 v 11:50 odesílatel Amit Kapila > napsal: >> >> Thanks, but are you planning to look at the other thread mentioned in >> my previous email? We need to finish that before this. > > > I check it now - it has sense. the

Re: dropdb --force

2019-11-08 Thread Pavel Stehule
pá 8. 11. 2019 v 11:50 odesílatel Amit Kapila napsal: > On Fri, Nov 8, 2019 at 4:13 PM Pavel Stehule > wrote: > > > >>> Did you get a chance to look at the other related patch posted by me > >>> [1]? I have asked it before as well because I think that need to go > >>> before this. We need to

Re: dropdb --force

2019-11-08 Thread Amit Kapila
On Fri, Nov 8, 2019 at 4:13 PM Pavel Stehule wrote: > >>> Did you get a chance to look at the other related patch posted by me >>> [1]? I have asked it before as well because I think that need to go >>> before this. We need to avoid errors to happen after terminating the >>> connections as

Re: dropdb --force

2019-11-08 Thread Pavel Stehule
pá 8. 11. 2019 v 6:40 odesílatel Pavel Stehule napsal: > > > pá 8. 11. 2019 v 6:39 odesílatel Amit Kapila > napsal: > >> On Thu, Nov 7, 2019 at 11:29 AM Pavel Stehule >> wrote: >> > čt 7. 11. 2019 v 6:56 odesílatel Amit Kapila >> napsal: >> >> >> >> Okay, no problem. I will pick the previous

Re: dropdb --force

2019-11-07 Thread Pavel Stehule
pá 8. 11. 2019 v 6:39 odesílatel Amit Kapila napsal: > On Thu, Nov 7, 2019 at 11:29 AM Pavel Stehule > wrote: > > čt 7. 11. 2019 v 6:56 odesílatel Amit Kapila > napsal: > >> > >> Okay, no problem. I will pick the previous version and do this. I > >> will post the patch in a day or so for

Re: dropdb --force

2019-11-07 Thread Amit Kapila
On Thu, Nov 7, 2019 at 11:29 AM Pavel Stehule wrote: > čt 7. 11. 2019 v 6:56 odesílatel Amit Kapila napsal: >> >> Okay, no problem. I will pick the previous version and do this. I >> will post the patch in a day or so for your review. > > > Thank you very much > Did you get a chance to look

Re: dropdb --force

2019-11-06 Thread Pavel Stehule
čt 7. 11. 2019 v 6:56 odesílatel Amit Kapila napsal: > On Thu, Nov 7, 2019 at 10:46 AM Pavel Stehule > wrote: > > > > čt 7. 11. 2019 v 3:42 odesílatel Amit Kapila > napsal: > >> > >> On Wed, Nov 6, 2019 at 11:46 PM Pavel Stehule > wrote: > >> > > >> > st 6. 11. 2019 v 14:59 odesílatel Tom

Re: dropdb --force

2019-11-06 Thread Amit Kapila
On Thu, Nov 7, 2019 at 10:46 AM Pavel Stehule wrote: > > čt 7. 11. 2019 v 3:42 odesílatel Amit Kapila napsal: >> >> On Wed, Nov 6, 2019 at 11:46 PM Pavel Stehule >> wrote: >> > >> > st 6. 11. 2019 v 14:59 odesílatel Tom Lane napsal: >> >> >> >> Amit Kapila writes: >> >> > I think there is

Re: dropdb --force

2019-11-06 Thread Pavel Stehule
čt 7. 11. 2019 v 3:42 odesílatel Amit Kapila napsal: > On Wed, Nov 6, 2019 at 11:46 PM Pavel Stehule > wrote: > > > > st 6. 11. 2019 v 14:59 odesílatel Tom Lane napsal: > >> > >> Amit Kapila writes: > >> > I think there is still a window where the same problem can happen, say > >> > the

Re: dropdb --force

2019-11-06 Thread Amit Kapila
On Wed, Nov 6, 2019 at 11:46 PM Pavel Stehule wrote: > > st 6. 11. 2019 v 14:59 odesílatel Tom Lane napsal: >> >> Amit Kapila writes: >> > I think there is still a window where the same problem can happen, say >> > the signal has been sent by SendProcSignal to the required process and >> > it

Re: dropdb --force

2019-11-06 Thread Pavel Stehule
st 6. 11. 2019 v 14:59 odesílatel Tom Lane napsal: > Amit Kapila writes: > > I think there is still a window where the same problem can happen, say > > the signal has been sent by SendProcSignal to the required process and > > it releases the ProcArrayLock. Now, the target process exits and a

Re: dropdb --force

2019-11-06 Thread Tom Lane
Amit Kapila writes: > I think there is still a window where the same problem can happen, say > the signal has been sent by SendProcSignal to the required process and > it releases the ProcArrayLock. Now, the target process exits and a > new process gets the same pid before the signal is

Re: dropdb --force

2019-11-06 Thread Amit Kapila
On Sun, Nov 3, 2019 at 2:08 AM Pavel Stehule wrote: > >> pá 25. 10. 2019 v 4:55 odesílatel Amit Kapila >> napsal: >>> >>> On Thu, Oct 24, 2019 at 8:22 PM Pavel Stehule >>> wrote: >>> > >>> > čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila >>> > napsal: >>> >> >>> >> While making some

Re: dropdb --force

2019-11-02 Thread Pavel Stehule
> I am sending patch where kill was replaced by SendProcSignal. I tested it > on pg_bench with 400 connections, and it works without problems. > I tested it under high load and it is works. But it is slower than just kill - under load the killing 400 connections needs about 1.5 sec. Maybe for

Re: dropdb --force

2019-11-02 Thread Pavel Stehule
Hi so 2. 11. 2019 v 17:18 odesílatel Pavel Stehule napsal: > > > pá 25. 10. 2019 v 4:55 odesílatel Amit Kapila > napsal: > >> On Thu, Oct 24, 2019 at 8:22 PM Pavel Stehule >> wrote: >> > >> > čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila >> napsal: >> >> >> >> While making some changes in

Re: dropdb --force

2019-11-02 Thread Pavel Stehule
pá 25. 10. 2019 v 4:55 odesílatel Amit Kapila napsal: > On Thu, Oct 24, 2019 at 8:22 PM Pavel Stehule > wrote: > > > > čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila > napsal: > >> > >> While making some changes in the patch, I noticed that in > >> TerminateOtherDBBackends, there is a race

Re: dropdb --force

2019-10-24 Thread Amit Kapila
On Thu, Oct 24, 2019 at 8:22 PM Pavel Stehule wrote: > > čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila > napsal: >> >> While making some changes in the patch, I noticed that in >> TerminateOtherDBBackends, there is a race condition where after we >> release the ProcArrayLock, the backend

Re: dropdb --force

2019-10-24 Thread Pavel Stehule
čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila napsal: > On Wed, Oct 23, 2019 at 12:59 PM Amit Kapila > wrote: > > > > On Tue, Oct 22, 2019 at 4:51 PM Pavel Stehule > wrote: > > > > > > út 22. 10. 2019 v 5:09 odesílatel Amit Kapila > napsal: > > >> > > >> > > >> CountOtherDBBackends is called

Re: dropdb --force

2019-10-24 Thread Amit Kapila
On Wed, Oct 23, 2019 at 12:59 PM Amit Kapila wrote: > > On Tue, Oct 22, 2019 at 4:51 PM Pavel Stehule wrote: > > > > út 22. 10. 2019 v 5:09 odesílatel Amit Kapila > > napsal: > >> > >> > >> CountOtherDBBackends is called from other places as well, so I don't > >> think it is advisable to

Re: dropdb --force

2019-10-23 Thread Amit Kapila
On Tue, Oct 22, 2019 at 4:51 PM Pavel Stehule wrote: > > út 22. 10. 2019 v 5:09 odesílatel Amit Kapila > napsal: >> >> >> CountOtherDBBackends is called from other places as well, so I don't >> think it is advisable to change the sleep time in that function. >> Also, I don't want to add a

Re: dropdb --force

2019-10-22 Thread Pavel Stehule
út 22. 10. 2019 v 5:09 odesílatel Amit Kapila napsal: > On Mon, Oct 21, 2019 at 2:15 PM Pavel Stehule > wrote: > > > > po 21. 10. 2019 v 10:25 odesílatel Amit Kapila > napsal: > >> > >> > >> Sorry, but I am not able to understand the reason. Are you worried > >> about the comments atop

Re: dropdb --force

2019-10-21 Thread Amit Kapila
On Mon, Oct 21, 2019 at 2:15 PM Pavel Stehule wrote: > > po 21. 10. 2019 v 10:25 odesílatel Amit Kapila > napsal: >> >> >> Sorry, but I am not able to understand the reason. Are you worried >> about the comments atop CountOtherDBBackends which says it is used in >> Drop Database and related

Re: dropdb --force

2019-10-21 Thread Pavel Stehule
po 21. 10. 2019 v 10:25 odesílatel Amit Kapila napsal: > On Mon, Oct 21, 2019 at 12:24 PM Pavel Stehule > wrote: > > > > po 21. 10. 2019 v 8:38 odesílatel Amit Kapila > napsal: > >> > >> > If we don't wait in TerminateOtherDBBackends, then probably there > should be necessary some cycles

Re: dropdb --force

2019-10-21 Thread Pavel Stehule
Hi > When you say 'without any problem', do you mean to say that the drop > database is successful? In your tests were those sessions idle? If > so, I think we should try with busy sessions. Also, if you write any > script to do these tests, kindly share the same so that others can > also

Re: dropdb --force

2019-10-21 Thread Amit Kapila
On Mon, Oct 21, 2019 at 11:08 AM Pavel Stehule wrote: > > po 21. 10. 2019 v 7:11 odesílatel Amit Kapila > napsal: >> >> >(under low load (only pg_sleep was called). >> > >> >> I guess this is also possible because immediately after >> TerminateOtherDBBackends, we call CountOtherDBBackends which

Re: dropdb --force

2019-10-20 Thread Pavel Stehule
po 21. 10. 2019 v 7:11 odesílatel Amit Kapila napsal: > On Sun, Oct 20, 2019 at 2:06 AM Pavel Stehule > wrote: > > > > so 19. 10. 2019 v 12:37 odesílatel Amit Kapila > napsal: > >> > >> On Fri, Oct 4, 2019 at 9:54 PM Pavel Stehule > wrote: > >> > > >> >> > >> >> Can we add few tests for this

Re: dropdb --force

2019-10-20 Thread Amit Kapila
On Sun, Oct 20, 2019 at 2:06 AM Pavel Stehule wrote: > > so 19. 10. 2019 v 12:37 odesílatel Amit Kapila > napsal: >> >> On Fri, Oct 4, 2019 at 9:54 PM Pavel Stehule wrote: >> > >> >> >> >> Can we add few tests for this feature. >> > >> > there are not any other test for DROP DATABASE >> > >>

Re: dropdb --force

2019-10-19 Thread Pavel Stehule
so 19. 10. 2019 v 12:37 odesílatel Amit Kapila napsal: > On Fri, Oct 4, 2019 at 9:54 PM Pavel Stehule > wrote: > > > >> > >> Can we add few tests for this feature. > > > > there are not any other test for DROP DATABASE > > > > I think there are no dedicated tests for it but in a few tests, we

Re: dropdb --force

2019-10-19 Thread Amit Kapila
On Fri, Oct 4, 2019 at 9:54 PM Pavel Stehule wrote: > >> >> Can we add few tests for this feature. > > there are not any other test for DROP DATABASE > I think there are no dedicated tests for it but in a few tests, we use it like in contrib\sepgsql\sql\alter.sql. I am not sure if we can write

Re: dropdb --force

2019-10-06 Thread Pavel Stehule
ne 6. 10. 2019 v 10:19 odesílatel vignesh C napsal: > On Fri, Oct 4, 2019 at 9:54 PM Pavel Stehule > wrote: > > > > > > > > čt 3. 10. 2019 v 19:48 odesílatel vignesh C > napsal: > >> > >> On Wed, Oct 2, 2019 at 10:21 PM Pavel Stehule > wrote: > >> > > >> > Thank you for careful review. I hope

Re: dropdb --force

2019-10-06 Thread vignesh C
On Fri, Oct 4, 2019 at 9:54 PM Pavel Stehule wrote: > > > > čt 3. 10. 2019 v 19:48 odesílatel vignesh C napsal: >> >> On Wed, Oct 2, 2019 at 10:21 PM Pavel Stehule >> wrote: >> > >> > Thank you for careful review. I hope so all issues are out. >> > >> > >> Thanks Pavel for fixing the comments.

Re: dropdb --force

2019-10-04 Thread Pavel Stehule
čt 3. 10. 2019 v 19:48 odesílatel vignesh C napsal: > On Wed, Oct 2, 2019 at 10:21 PM Pavel Stehule > wrote: > > > > Thank you for careful review. I hope so all issues are out. > > > > > Thanks Pavel for fixing the comments. > Few comments: > The else part cannot be hit in DropDatabase function

Re: dropdb --force

2019-10-04 Thread vignesh C
On Thu, Oct 3, 2019 at 11:18 PM vignesh C wrote: > > On Wed, Oct 2, 2019 at 10:21 PM Pavel Stehule wrote: > > > > Thank you for careful review. I hope so all issues are out. > > > > > Thanks Pavel for fixing the comments. > Few comments: > The else part cannot be hit in DropDatabase function as

Re: dropdb --force

2019-10-03 Thread vignesh C
On Wed, Oct 2, 2019 at 10:21 PM Pavel Stehule wrote: > > Thank you for careful review. I hope so all issues are out. > > Thanks Pavel for fixing the comments. Few comments: The else part cannot be hit in DropDatabase function as gram.y expects FORCE. + + if (strcmp(opt->defname, "force") == 0) +

Re: dropdb --force

2019-10-02 Thread Pavel Stehule
st 2. 10. 2019 v 5:20 odesílatel Amit Kapila napsal: > On Thu, Sep 26, 2019 at 7:18 PM Pavel Stehule > wrote: > >> >> út 24. 9. 2019 v 14:52 odesílatel Amit Kapila >> napsal: >> >>> >>> One other minor comment: >>> + >>> + This will also fail, if the connections do not terminate in 5 >>>

Re: dropdb --force

2019-10-01 Thread Amit Kapila
On Thu, Sep 26, 2019 at 7:18 PM Pavel Stehule wrote: > > út 24. 9. 2019 v 14:52 odesílatel Amit Kapila > napsal: > >> >> One other minor comment: >> + >> + This will also fail, if the connections do not terminate in 5 >> seconds. >> + >> >> Is there any implementation in the patch for

Re: dropdb --force

2019-09-26 Thread Amit Kapila
On Thu, Sep 26, 2019 at 10:04 PM Peter Eisentraut wrote: > > On 2019-09-26 17:35, Alvaro Herrera wrote: > > 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

Re: dropdb --force

2019-09-26 Thread Pavel Stehule
čt 26. 9. 2019 v 18:34 odesílatel Peter Eisentraut < peter.eisentr...@2ndquadrant.com> napsal: > On 2019-09-26 17:35, Alvaro Herrera wrote: > > Well, you would have one of those: > > > > DROP DATABASE [IF EXISTS] name WITH (FORCE) > > DROP DATABASE [IF EXISTS] name > > > > Naturally, the WITH is

Re: dropdb --force

2019-09-26 Thread Peter Eisentraut
On 2019-09-26 17:35, Alvaro Herrera wrote: > 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

Re: dropdb --force

2019-09-26 Thread Pavel Stehule
čt 26. 9. 2019 v 17:35 odesílatel Alvaro Herrera 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).

Re: dropdb --force

2019-09-26 Thread Alvaro Herrera
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

Re: dropdb --force

2019-09-26 Thread Pavel Stehule
st 25. 9. 2019 v 4:14 odesílatel Amit Kapila napsal: > On Tue, Sep 24, 2019 at 6:22 PM Amit Kapila > wrote: > > On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule > wrote: > > > > > > Thank you for check. I am sending updated patch > > > > > > > Alvaro has up thread suggested some alternative

Re: dropdb --force

2019-09-26 Thread Pavel Stehule
st 25. 9. 2019 v 6:38 odesílatel vignesh C napsal: > On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule > wrote: > > fixed > > > > Thank you for check. I am sending updated patch > > > Thanks for fixing all the comments. > Couple of suggestions: > -DROP DATABASE [ IF EXISTS ]

Re: dropdb --force

2019-09-26 Thread Pavel Stehule
út 24. 9. 2019 v 17:51 odesílatel vignesh C napsal: > On Tue, Sep 24, 2019 at 6:22 PM Amit Kapila > wrote: > > > > On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule > wrote: > > > > > > Thank you for check. I am sending updated patch > > > > > > Session termination in case of drop database is

Re: dropdb --force

2019-09-26 Thread Pavel Stehule
út 24. 9. 2019 v 14:52 odesílatel Amit Kapila napsal: > On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule > wrote: > > > > Thank you for check. I am sending updated patch > > > > Alvaro has up thread suggested some alternative syntax [1] for this > patch, but I don't see any good argument to not

Re: dropdb --force

2019-09-24 Thread vignesh C
On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule wrote: > fixed > > Thank you for check. I am sending updated patch > Thanks for fixing all the comments. Couple of suggestions: -DROP DATABASE [ IF EXISTS ] name +DROP DATABASE [ ( option [, ...] ) ] [ IF EXISTS ] name + +where option can be one of:

Re: dropdb --force

2019-09-24 Thread Amit Kapila
On Tue, Sep 24, 2019 at 6:22 PM Amit Kapila wrote: > On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule > wrote: > > > > Thank you for check. I am sending updated patch > > > > Alvaro has up thread suggested some alternative syntax [1] for this > patch, but I don't see any good argument to not go

Re: dropdb --force

2019-09-24 Thread vignesh C
On Tue, Sep 24, 2019 at 6:22 PM Amit Kapila wrote: > > On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule > wrote: > > > > Thank you for check. I am sending updated patch > > > Session termination in case of drop database is solved. Some typos: + /* + * Similar code to pg_terminate_backend, but we

Re: dropdb --force

2019-09-24 Thread Amit Kapila
On Sat, Sep 21, 2019 at 10:09 PM Pavel Stehule wrote: > > Thank you for check. I am sending updated patch > Alvaro has up thread suggested some alternative syntax [1] for this patch, but I don't see any good argument to not go with what he has proposed. In other words, why we should prefer the

Re: dropdb --force

2019-09-21 Thread Pavel Stehule
pá 20. 9. 2019 v 5:10 odesílatel Thomas Munro napsal: > On Thu, Sep 19, 2019 at 6:44 AM Pavel Stehule > wrote: > > I am sending updated version > > +appendPQExpBuffer(, "DROP DATABASE %s%s%s;", > + (force ? " (FORCE) " : ""), > > An extra space before (FORCE) caused the

Re: dropdb --force

2019-09-21 Thread Pavel Stehule
pá 20. 9. 2019 v 7:58 odesílatel Dilip Kumar napsal: > On Thu, Sep 19, 2019 at 12:14 AM Pavel Stehule > wrote: > > > > Hi > > > > I am sending updated version - the changes against last patch are two. I > use pg_terminate_backed for killing other terminates like Tom proposed. I > am not sure if

Re: dropdb --force

2019-09-19 Thread Dilip Kumar
On Thu, Sep 19, 2019 at 12:14 AM Pavel Stehule wrote: > > Hi > > I am sending updated version - the changes against last patch are two. I use > pg_terminate_backed for killing other terminates like Tom proposed. I am not > sure if it is 100% practical - on second hand the necessary right to

Re: dropdb --force

2019-09-19 Thread vignesh C
On Thu, Sep 19, 2019 at 11:41 PM Pavel Stehule wrote: > > > > čt 19. 9. 2019 v 13:52 odesílatel vignesh C napsal: >> >> On Thu, Sep 19, 2019 at 12:14 AM Pavel Stehule >> wrote: >> > >> > Hi >> > >> > I am sending updated version - the changes against last patch are two. I >> > use

Re: dropdb --force

2019-09-19 Thread vignesh C
On Thu, Sep 19, 2019 at 12:14 AM Pavel Stehule wrote: > > Hi > > I am sending updated version - the changes against last patch are two. I use > pg_terminate_backed for killing other terminates like Tom proposed. I am not > sure if it is 100% practical - on second hand the necessary right to

Re: dropdb --force

2019-09-18 Thread Pavel Stehule
Hi I am sending updated version - the changes against last patch are two. I use pg_terminate_backed for killing other terminates like Tom proposed. I am not sure if it is 100% practical - on second hand the necessary right to kill other sessions is almost available - and consistency with

Re: dropdb --force

2019-09-18 Thread Pavel Stehule
st 18. 9. 2019 v 19:11 odesílatel vignesh C napsal: > On Wed, Sep 18, 2019 at 9:41 AM Pavel Stehule > wrote: > > > > > > > > st 18. 9. 2019 v 5:59 odesílatel vignesh C napsal: > >> > >> On Wed, Sep 18, 2019 at 8:30 AM Pavel Stehule > wrote: > >> > > >> > > >> Hi Pavel, > >> > >> One Comment:

Re: dropdb --force

2019-09-18 Thread vignesh C
On Wed, Sep 18, 2019 at 9:41 AM Pavel Stehule wrote: > > > > st 18. 9. 2019 v 5:59 odesílatel vignesh C napsal: >> >> On Wed, Sep 18, 2019 at 8:30 AM Pavel Stehule >> wrote: >> > >> > >> Hi Pavel, >> >> One Comment: >> In the documentation we say drop database will fail after 60 seconds >>

Re: dropdb --force

2019-09-17 Thread Pavel Stehule
st 18. 9. 2019 v 5:59 odesílatel vignesh C napsal: > On Wed, Sep 18, 2019 at 8:30 AM Pavel Stehule > wrote: > > > > > Hi Pavel, > > One Comment: > In the documentation we say drop database will fail after 60 seconds > > FORCE > > > Attempt to terminate all existing

Re: dropdb --force

2019-09-17 Thread vignesh C
On Wed, Sep 18, 2019 at 8:30 AM Pavel Stehule wrote: > > Hi Pavel, One Comment: In the documentation we say drop database will fail after 60 seconds FORCE Attempt to terminate all existing connections to the target database. This will fail, if current

  1   2   >