Re: dropdb --force

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Ryan Lambert <ryan(at)rustprooflabs(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Anthony Nowocien <anowocien(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>
Subject: Re: dropdb --force
Date: 2019-11-22 09:57:58
Message-ID: CAFj8pRBE1vVnQ6m9szChPYciAT3Dfwo9z4QvWgY4+dyiEP2zKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 22. 11. 2019 v 10:46 odesílatel vignesh C <vignesh21(at)gmail(dot)com> napsal:

> On Fri, Nov 22, 2019 at 12:10 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> >
> >
> >
> > čt 21. 11. 2019 v 6:33 odesílatel vignesh C <vignesh21(at)gmail(dot)com>
> napsal:
> >>
> >> On Mon, Nov 18, 2019 at 6:30 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> 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, or timeout occurs
> >> +sub pump_until
> >> +{
> >> + my ($proc, $stream, $untl) = @_;
> >> + $proc->pump_nb();
> >> + while (1)
> >> + {
> >> + last if $$stream =~ /$untl/;
> >> + if ($psql_timeout->is_expired)
> >> + {
> >
> >
> > yes, I know - probably it can be moved to testlib.pm. Unfortunately it
> is perl, and I am not able to this correctly. More it use global object -
> timer
> >
> >> This can be Tests drop database with force option:
> >
> >
> > done
> >
> >> +#
> >> +# Tests killing session connected to dropped database
> >> +#
> >>
> >> This can be changed to check database foobar1 does not exist.
> >
> >
> > done
> >
> >> +# and there is not a database with this name
> >> +is($node->safe_psql('postgres', qq[SELECT EXISTS(SELECT * FROM
> >> pg_database WHERE datname='foobar1');]),
> >> + 'f', 'database foobar1 was removed');
> >>
> >> This can be changed to check the connections on foobar1 database
> >> +
> >> +# and it is connected to foobar1 database
> >> +is($node->safe_psql('postgres', qq[SELECT pid FROM pg_stat_activity
> >> WHERE datname='foobar1' AND pid = $pid;]),
> >> + $pid, 'database foobar1 is used');
> >
> >
> > done
> >
> >>
> >> This can be changed to restart psql as the previous connection will be
> >> terminated by previous drop database.
> >> +
> >
> >
> > done
> >
> > new patch attached
> >
>
> 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.
>

thank you

looks well

Pavel

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-11-22 10:21:53 Re: base backup client as auxiliary backend process
Previous Message Rushabh Lathia 2019-11-22 09:57:53 Re: backup manifests