Re: hash_create(): check return code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: hash_create(): check return code
Дата
Msg-id 3621.1098425639@sss.pgh.pa.us
обсуждение исходный текст
Ответ на hash_create(): check return code  (Neil Conway <neilc@samurai.com>)
Ответы Re: hash_create(): check return code  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> I'm not really sure whether this is the correct fix, but it certainly
> seems wrong to be doing the check in some places and not in others.
> Another approach would be to elog(ERROR) when an error occurs in
> hash_create(), which would be fine except there might be some
> circumstances in which hash_create() is invoked but elog(ERROR) is not
> setup yet.

There are no places where hash_create is called before elog() is
functional.  I'd go for putting the error into hash_create, I think,
because I can't imagine any caller not wanting to error out.  (If
there is any such caller, it can always catch it with PG_TRY.)

            regards, tom lane

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

Предыдущее
От: Neil Conway
Дата:
Сообщение: code cleanup in dynahash.c
Следующее
От: Neil Conway
Дата:
Сообщение: Re: hash_create(): check return code