开发者

how to install postgres' tablefunc as non-poweruser

As part of our php data test framework, we start by dropping & creating a test database for the user running the test (l开发者_高级运维et's call him 'foo').

Our template1 does not have a public schema. This is because we need the test db to have 'public' owned by 'foo' (and by default, even if 'foo' creates a db, Postgres will make 'public' owned by 'postgres', not 'foo')

Now, we need to install tablefunc on this test database. Tablefunc includes C functions that cannot be installed as non-superuser (e.g. our user 'foo')

Can, and How can this be acheived ? In any case, our php data tests MUST be run as non-superuser.


You could temporarily treat c language as trusted language and install tablefunc as non-superuser:

UPDATE pg_language SET lanpltrusted = true WHERE lanname LIKE 'c';

See my previous answer for more details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜