Re: Add force option to dropdb

From: salah jubeh <s_jubeh(at)yahoo(dot)com>
To: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add force option to dropdb
Date: 2014-01-28 14:01:39
Message-ID: 1390917699.56331.YahooMailNeo@web164803.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Sawada,

>- This patch is not patched to master branch

Sorry, My mistake
>//new connections are not allowed
Corrected.

I hope now the patch in better state, if somthing left, I will be glad to fix it

Regards

On Tuesday, January 28, 2014 4:17 AM, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com> wrote:

On 2014年1月17日 0:56, salah jubeh <s_jubeh(at)yahoo(dot)com> wrote:
>
>>If the user owns objects, that will prevent this from working also.  I
>>have the feeling that adding DROP OWNED BY and/or REASSIGNED OWNED BY
>>calls to this utility would be a bit excessive, but who knows.
>
> Please find attached the first attempt to drop drop the client connections.
> I have added an option -k, --kill instead of force since killing client
> connection does not guarantee -drop force-.
> Regards
>
>
> On Tuesday, January 14, 2014 8:06 PM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)com> wrote:
> salah jubeh wrote:
>
>> For the sake of completeness:
>> 1. I think also, I need also to temporary disallow conecting to the
>> database, is that right?
>> 2. Is there other factors can hinder dropping database?
>
> If the user owns objects, that will prevent this from working also.  I
> have the feeling that adding DROP OWNED BY and/or REASSIGNED OWNED BY
> calls to this utility would be a bit excessive, but who knows.
>
>
>> 3. Should I write two patches one for pg_version>=9.2 and one for
>> pg_version<9.2
>
>
> No point -- nothing gets applied to branches older than current
> development anyway.
>

Thank you for the patch.
And sorry for delay in reviewing.

I started to look this patch, So the following is first review comment.

- This patch is not patched to master branch
I tried to patch this patch file to master branch, but I got following error.
$ cd postgresql
$ patch -d. -p1 < ../dropdb.patch
can't find fiel to patch at input line 3
Perhaps you used the wrong -p or --strip option?
the text leading up to this was:
------------------------------
|--- dropdb_org.c 2014-01-16
|+++ dropdb.c 2014-01-16
------------------------------

There is not dropdb_org.c. I think  that you made mistake when the
patch is created.

- This patch is not according the coding rule
For example, line 71 of the patch:
//new connections are not allowed
It should be:
/* new connections are not allowed */
(Comment blocks that need specific line breaks should be formatted as
block comments, where the comment starts as /*------.)
Please refer to coding rule.
<http://wiki.postgresql.org/wiki/Developer_FAQ#What.27s_the_formatting_style_used_in_PostgreSQL_source_code.3F>

Regards,

-------
Sawada Masahiko

Attachment Content-Type Size
dropdb.patch text/x-patch 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-01-28 14:03:51 Re: Planning time in explain/explain analyze
Previous Message Heikki Linnakangas 2014-01-28 13:54:53 Re: KNN-GiST with recheck