Re: 回复:A question about leakproof

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 回复:A question about leakproof
Дата
Msg-id 2077794.1665977617@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 回复:A question about leakproof  ("qiumingcheng" <qiumingcheng@aliyun.com>)
Ответы Re: 回复:A question about leakproof  ("David G. Johnston" <david.g.johnston@gmail.com>)
回复:回复:A question about leakproof  ("qiumingcheng" <qiumingcheng@aliyun.com>)
Список pgsql-general
"qiumingcheng" <qiumingcheng@aliyun.com> writes:
> 1. In the test example I gave, the in4eq function's proleakproof=true, but its actual test result is leaking. Does
thatmean you will adjust it to proleakproof=false later? 

int4eq is about as leakproof as a function could possibly be: it does
not leak, it's plain from the code of the function that it does not
leak, and it calls no other code that might accidentally introduce
a leak in future.

I think you do not understand what that property actually means.
Per the CREATE FUNCTION man page:

       LEAKPROOF indicates that the function has no side
       effects.  It reveals no information about its arguments other than by
       its return value.  For example, a function which throws an error message
       for some argument values but not others, or which includes the argument
       values in any error message, is not leakproof.

Please note that this definition talks only about the behavior
of the function itself.  Re-reading your email, you seem to be
imagining that changes in a query's plan on the basis of changes in
collected statistics have something to do with this.  They do not.

            regards, tom lane



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

Предыдущее
От: "qiumingcheng"
Дата:
Сообщение: 回复:A question about leakproof
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: 回复:A question about leakproof