Re: Time to drop old-style (V0) functions?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Time to drop old-style (V0) functions?
Дата
Msg-id 20161208230804.ayt2zcrq4uzkcuva@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Time to drop old-style (V0) functions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2016-12-08 18:03:04 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2016-12-08 17:38:38 -0500, Tom Lane wrote:
> >> The habit of zero-initializing Datums has got exactly nothing to do with
> >> V0 functions; it's about ensuring consistent results and avoiding
> >> heisenbugs from use of uninitialized memory.  I do not think we should
> >> drop it.
> 
> > Well, V0 functions don't have a real way to get information about NULL,
> > and we allow non-strict V0 functions, so?
> 
> Non-strict V0 functions are pretty fundamentally broken, although IIRC
> there was some hack whereby they could see the isnull marker for their
> first argument, which is why we didn't just disallow the case.  There was
> never any expectation that checking for value == 0 was an appropriate
> coding method for detecting nulls, because it couldn't work for
> pass-by-value data types.

Well, we have a bunch in our regression tests ;). And I'm not saying
it's *good* that they rely on that, I think it's a reason to drop the
whole V0 interface.

(I also suspect there's a bunch in brin related to this)


> Again, the point of initializing those values is not to support broken
> tests for nullness.  It's to ensure consistent behavior in case of
> buggy attempts to use null values.

Well, it also makes such attempts undetectable. I'm not really convinced
that that's such an improvement.


Greetings,

Andres Freund



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Time to drop old-style (V0) functions?
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] pg_dump vs. TRANSFORMs