Re: Database-level collation version tracking

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Database-level collation version tracking
Дата
Msg-id 53b309c4-22c2-c781-5a54-ee4d824e8478@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Database-level collation version tracking  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Database-level collation version tracking
Список pgsql-hackers
On 08.02.22 13:55, Julien Rouhaud wrote:
> I'm just saying that without such a lock you can easily trigger the "cache
> lookup" error, and that's something that's supposed to happen with normal
> usage I think.  So it should be a better message saying that the database has
> been concurrently dropped, or actually simply does not exist like it's done in
> AlterDatabaseOwner() for the same pattern:
> 
> [...]
>     tuple = systable_getnext(scan);
>     if (!HeapTupleIsValid(tuple))
>         ereport(ERROR,
>                 (errcode(ERRCODE_UNDEFINED_DATABASE),
>                  errmsg("database \"%s\" does not exist", dbname)));
> [...]

In my code, the existence of the database is checked by

     dboid = get_database_oid(stmt->dbname, false);

This also issues an appropriate user-facing error message if the 
database does not exist.

The flow in AlterDatabaseOwner() is a bit different, it looks up the 
pg_database tuple directly from the name.  I think both are correct.  My 
code has been copied from the analogous code in AlterCollation().



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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: Possible uninitialized use of the variables (src/backend/access/transam/twophase.c)
Следующее
От: Ashutosh Sharma
Дата:
Сообщение: Re: Make mesage at end-of-recovery less scary.