[pgpool-general: 1747] Re: Problems running jdbc testsuite

Christoph Berg myon+oss.postgresql at df7cb.de
Wed May 15 15:27:03 JST 2013


Re: Tatsuo Ishii 2013-05-13 <20130514.080745.429245314798328981.t-ishii at sraoss.co.jp>
> >> SELECT count(*) FROM pg_catalog.pg_proc AS p WHERE
> >> p.proname = 'pgpool_regclass' AND has_function_privilege('postgres',
> >> 'pgpool_regclass(cstring)', 'execute')
> 
> pgpool-II expects that this query returns 0 if pgpool_regclass() is
> not installed, but actually it returns ERROR. Attached patch should
> solve the problem.

The query works here, yes.

> -#define HASPGPOOL_REGCLASSQUERY "SELECT count(*) FROM pg_catalog.pg_proc AS p WHERE p.proname = 'pgpool_regclass' AND has_function_privilege('%s', 'pgpool_regclass(cstring)', 'execute')"
> +#define HASPGPOOL_REGCLASSQUERY "SELECT count(*) from (SELECT has_function_privilege('%s', 'pgpool_regclass(cstring)', 'execute') WHERE EXISTS(SELECT * FROM pg_catalog.pg_proc AS p WHERE p.proname = 'pgpool_regclass')) AS s"

Haven't read any code around this, but wouldn't "current_user" work as
well in place of the "'%s'" there?

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/


More information about the pgpool-general mailing list