As part of our php data test framework, we start by dropping & creating a test database for the user running the test (let’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
clanguage as trusted language and install tablefunc as non-superuser:See my previous answer for more details