Re: [PATCH] PageGetTempPage cleanup

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] PageGetTempPage cleanup
Дата
Msg-id 22307.1225745600@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PATCH] PageGetTempPage cleanup  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Ответы Re: [PATCH] PageGetTempPage cleanup  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Список pgsql-hackers
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> I attach patch which cleans up code around PageGetTempPage. These changes were 
> discussed here:
> http://archives.postgresql.org/pgsql-hackers/2008-08/msg00102.php

Applied with a minor change: instead of inventingPage PageGetTempPage(Page page, bool copy)
I split it into two functionsPage PageGetTempPage(Page page)Page PageGetTempPageCopy(Page page)
I don't see any advantage to having the single function, because it
doesn't seem like any calling code path would be likely to want both
behaviors depending on some condition.  Moreover, the way you had it
meant that we'd be replacingPage PageGetTempPage(Page page, Size specialSize);
withPage PageGetTempPage(Page page, bool copy);
which seems risky to me.  If someone failed to update code that was
meant to call the old API, they'd get no warning about it --- at least
not in any C compiler I'm familiar with.  Changing the number of
arguments guarantees a compile error for un-updated code.
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Second thoughts about pg_typeof
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] reliable lock inside stored procedure (SOLVED)