Re: Add force option to dropdb

Поиск
Список
Период
Сортировка
От salah jubeh
Тема Re: Add force option to dropdb
Дата
Msg-id 1391187501.46507.YahooMailNeo@web164805.mail.gq1.yahoo.com
обсуждение исходный текст
Ответ на Re: Add force option to dropdb  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hello Robert,
>but the scripts are intended to be thin wrappers around
>the underlying database functionality, and I think this is straying
>too far from that core mission.

I think, you have a  good point here.
Regards


On Friday, January 31, 2014 4:47 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, Jan 31, 2014 at 9:09 AM, salah jubeh <s_jubeh@yahoo.com> wrote:
>>$ createdb -U postgres hoge
>>$ psql -d hoge -U postgres
>>hoge=# create table test (col text);
>>hoge=# insert into test select repeat(chr(code),10000) from
>>generate_series(1,100000) code;
>
>><Execute dropdb -k while the client is inserting many tuples into database>
>>$ dropdb -k hoge
>>2014-01-29 23:10:49 JST FATAL:  terminating connection due to
>>administrator command
>>2014-01-29 23:10:49 JST STATEMENT:  insert into test select
>>repeat(chr(code),10000) from generate_series(1,2000000) code;
>>2014-01-29 23:10:54 JST ERROR:  database "hoge" is being accessed by other
>> users
>>2014-01-29 23:10:54 JST DETAIL:  There is 1 other session using the
>> database.
>>2014-01-29 23:10:54 JST STATEMENT:  DROP DATABASE hoge;
>
>>2014-01-29 23:10:54 JST ERROR:  syntax error at or near ""hoge"" at
>> character 41
>>2014-01-29 23:10:54 JST STATEMENT:  UPDATE pg_database SET
>>datconnlimit = e "hoge" is being accessed by other users WHERE
>>datname= 'hoge';
>>dropdb: database removal failed: ERROR:  syntax error at or near ""hoge""
>>LINE 1: UPDATE pg_database SET datconnlimit = e "hoge" is being acce...
>                                                ^
>>hoge=# \l
>>                            List of databases
>>  Name    |  Owner  | Encoding | Collate | Ctype |  Access privileges
>>-----------+----------+----------+---------+-------+-----------------------
>>hoge      | postgres | UTF8    | C      | C    |
>>postgres  | postgres | UTF8    | C      | C    |
>>template0 | postgres | UTF8    | C      | C    | =c/postgres          +
>>          |          |          |        |      | postgres=CTc/postgres
>>template1 | postgres | UTF8    | C      | C    | =c/postgres          +
>>          |          |          |        |      | postgres=CTc/postgres
>
>>hoge database is not dropped yet.
>>Is this the bug? or not?
>
>  It is a bug, sorry for doubling your work. I have updated the patch.

In case it wasn't clear before, I think that a client-side hack like
this has zero chance of being acceptable to the community, and we
should mark this patch rejected.  I'm not saying it couldn't be useful
to someone, but the scripts are intended to be thin wrappers around
the underlying database functionality, and I think this is straying
too far from that core mission.


--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: updated emacs configuration
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [bug fix] PITR corrupts the database cluster