Re: allowing users access to a trusted C function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <jdavis(at)wasabimg(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: allowing users access to a trusted C function
Date: 2000-12-23 05:57:36
Message-ID: 24045.977551056@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Davis <jdavis(at)wasabimg(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2000-12-23 10:09:11 Performance and doing USENET style threaded messages
Previous Message Anand Raman 2000-12-23 04:25:54 Re: Max sessions question