Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"
Дата
Msg-id ka3462$2er$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane wrote on 09.12.2012 17:43:
> spam_eater@gmx.net writes:
>> postgres=# create user testuser with password 'secret';
>> CREATE ROLE
>> postgres=# create database testdb owner testuser;
>> CREATE DATABASE
>> testdb=> drop owned by testuser;
>> ERROR:  unrecognized object class: 1262
>
> I can reproduce this in all versions back to 8.3.  In 8.2, the role's
> ownership of the database is silently ignored, which I think was the
> design intention.  I doubt that we want DROP OWNED dropping whole
> databases.  At most maybe we should raise a NOTICE?
>

Just for clarification, this is how it worked in 9.1 (and I'm pretty sure in 9.2.1 as well):

First I create a testuser and the database:

C:\>psql -X -U postgres postgres
psql (9.1.3)

postgres=# create database testdb owner testuser;
ERROR:  role "testuser" does not exist
postgres=# create user testuser with password 'secret';
CREATE ROLE
postgres=# create database testdb owner testuser;
CREATE DATABASE
postgres=# \q

Then I log in as the testuser, create a table and drop all objects again:

C:\>psql -X -U testuser testdb
Password for user testuser:
psql (9.1.3)

testdb=> create table foobar (id integer);
CREATE TABLE
testdb=> drop owned by testuser;
DROP OWNED
testdb=>

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: init_htab causes SIGFPE (or worse) due to miscalculation for large nbuckets
Следующее
От: Tom Lane
Дата:
Сообщение: Re: init_htab causes SIGFPE (or worse) due to miscalculation for large nbuckets