[pgpool-hackers: 3752] Re: Using volatile property instead of black_function_list

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jul 30 15:47:09 JST 2020


> Hi Umar,
> 
>> Hi Tatsuo,
>> That would be a nice feature. Couple of comments:
>> 1. In case a "user dislikes it". ( as mentioned in the last proposal),  we
>> will ask users to add some dummy function name to disable this
>> functionality? or do we really need
>> an extra flag ?
> 
> Agreed. Adding some dummy function name should work for such users. We
> don't need an extra flag.
> 
>> 2. What would be overhead fetching catalog (memory & network usage), we
>> should document it if it could be significant.
> 
> Not significant, I think. However that should be documented to be
> fair.

Attached are patches for this. Japanese document patch will be created
later on.

Hou, Zhijie,

I have modified is_immutable_function() to make it more generaly
checks not only "immutable" but others including "volatile". While
doing this I noticed below in non-schema-qualified function name case.

The format string given to snprintf is:
SELECT count(*) FROM pg_catalog.pg_proc AS p, pg_catalog.pg_namespace
AS n WHERE p.proname %s '%s' AND n.oid = p.pronamespace AND n.nspname
= '%s' AND p.provolatile = 'i'"

with:

arg1 = "~"
arg2 = ".*"
arg3 = function name (for example "f1")

So the final SELECT query string will be:

SELECT count(*) FROM pg_catalog.pg_proc AS p, pg_catalog.pg_namespace
AS n WHERE p.proname ~ '.*' AND n.oid = p.pronamespace AND n.nspname
= 'f1' AND p.provolatile = 'i'"

So it seems the schema name and function name in this SELECT. The fix
is included in the 0001 patch but it would be nice if you could review
this.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-check-writing-function-using-volatility.patch
Type: text/x-patch
Size: 6215 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20200730/ec4b85d5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-document.patch
Type: text/x-patch
Size: 2715 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20200730/ec4b85d5/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-pgpool.conf.patch
Type: text/x-patch
Size: 6934 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20200730/ec4b85d5/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-regression-test.patch
Type: text/x-patch
Size: 1681 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20200730/ec4b85d5/attachment-0003.bin>


More information about the pgpool-hackers mailing list