From: Tom Lane <tgl@sss.pgh.pa.us>
To: qiumingcheng <qiumingcheng@aliyun.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: 回复:A question about leakproof
Date: Sun, 16 Oct 2022 23:33:37 -0400
Message-ID: <2077794.1665977617@sss.pgh.pa.us> (raw)
In-Reply-To: <9b7029cb-cd0d-494d-8628-93c7f8948117.qiumingcheng@aliyun.com>
References: <9cc93fdc-2f99-4963-b895-169135b742a8.qiumingcheng@aliyun.com>
<20221017014020.qpu2f5yy4lridhic@jrouhaud>
<2067840.1665971686@sss.pgh.pa.us>
<9b7029cb-cd0d-494d-8628-93c7f8948117.qiumingcheng@aliyun.com>
"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 that mean 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, qiumingcheng@aliyun.com, rjuju123@gmail.com
Subject: Re: 回复:A question about leakproof
In-Reply-To: <2077794.1665977617@sss.pgh.pa.us>
References: <9cc93fdc-2f99-4963-b895-169135b742a8.qiumingcheng@aliyun.com> <20221017014020.qpu2f5yy4lridhic@jrouhaud> <2067840.1665971686@sss.pgh.pa.us> <9b7029cb-cd0d-494d-8628-93c7f8948117.qiumingcheng@aliyun.com> <2077794.1665977617@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox