When FindConversion() is called, it also checks current user's ACL_EXECUTE
privilege on the conproc of the fetched conversion.
Why this check is applied on FindConversion(), instead of FindDefaultConversion()?
The FindConversion() returns the OID of conversion for the given name and
namespace, or InvalidOid if not found or user does not have ACL_EXECUTE
privilege.
It is called from DropConversionsCommand(), RenameConversion(),
AlterConversionOwner() and CommentConversion(), to obtain OID of the target
conversion to be modified by DDL statement.
On the other hand, FindDefaultConversionProc() does not apply such kind of
permission checks, though it is called from SetClientEncoding().
The conversion procedure is implicitly called when user communicates to
the server backend, so it seems to me quite natural if FindDefaultConversionProc()
checks user's ACL_EXECUTE privilege.
But it is checked when we lookup the target conversion on DDL statement.
It's unclear for me what is the intension of this check.
Thanks,
--
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>