Re: allowing users access to a trusted C function - Mailing list pgsql-general

From Tom Lane
Subject Re: allowing users access to a trusted C function
Date
Msg-id 24045.977551056@sss.pgh.pa.us
Whole thread Raw
In response to Re: allowing users access to a trusted C function  (Jeff Davis <jdavis@wasabimg.com>)
Responses Performance and doing USENET style threaded messages  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
LD_LIBRARY_PATH  (Chris Hayner <hayner80@astro.ocis.temple.edu>)
List pgsql-general
Jeff Davis <jdavis@wasabimg.com> writes:
>>>> I created (as a superuser) a set of C functions to handle boolean
>>>> arithmetic (has to do with simplifying search queries of mine). I would
>>>> like users to be able to access those functions somehow.
>>
>> If the functions are listed in pg_proc, anyone can call them.

> I should have mentioned this, but all my users have their own DB. I have
> entries for the functions in pg_proc for template1 and postgres (DB of my
> superuser), but they won't be recognized in other DBs.

Connect to each other DB (as superuser) and issue the CREATE FUNCTION
commands in that DB.

If you have created the functions in template1, subsequently-created DBs
will inherit the definitions automatically, since CREATE DATABASE clones
the state of template1.  But for a pre-existing DB, you gotta make the
pg_proc rows over again.

            regards, tom lane

pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: allowing users access to a trusted C function
Next
From: Lincoln Yeoh
Date:
Subject: Performance and doing USENET style threaded messages