Re: array_dims function is poorly behaved

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: array_dims function is poorly behaved
Дата
Msg-id 13363.1012601461@sss.pgh.pa.us
обсуждение исходный текст
Ответ на array_dims function is poorly behaved  (Marc Lavergne <mlavergn@richlava.com>)
Список pgsql-bugs
Marc Lavergne <mlavergn@richlava.com> writes:
> Simply use an array_dims() on any non-array type,

There is not a lot to be done about that, I'm afraid, since our type
system doesn't have a concept of "any array type".  The only way we
have to declare array_dims() is as a function taking any type at all;
so it can't protect itself against inputs that aren't arrays.

We could add some code in array_dims to try to detect the case where
it's handed a non-array pass-by-reference type; but I don't see how
it can guard against a pass-by-value parameter, which will typically
equate to an invalid pointer :-(

A bulletproof solution would require adding the notion of "any array
type" to the type checking system.  That might be a good thing to do
someday, but I'm not planning to hold my breath while waiting...

            regards, tom lane

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

Предыдущее
От: "Riendeau, Mike"
Дата:
Сообщение: Re: Sun Solaris 2.5.1 Seg Faults PostgreSQL7.1.3 build com
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgresSQL 7.1.3 not parsing SELECT portion of SQL correctly