Re: Making small bits of code available - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Making small bits of code available
Date
Msg-id 200209071652.g87Gq6011970@candle.pha.pa.us
Whole thread Raw
In response to Re: Making small bits of code available  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Making small bits of code available  (Bruno Wolff III <bruno@wolff.to>)
7.3 function permissions (was Re: Making small bits of code available)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Bruno Wolff III wrote:
> On Sat, Sep 07, 2002 at 10:05:14 -0400,
>   Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> >
> > What would be really valuable would be to add your routines to
> > /contrib/earthdistance.  Is that possible?
>
> Yes.
>
> Right now the script contains:
>
> Some leading comments
>
> grant execute to public commands for each function in contrib/cube
>
> A definition of the earth domain along with comments about what check
> constraints should be used (until domains support check constraints)
>
> For each new function there is a comment about it, a definition (using
> language 'sql') and a grant execute to public
>
> There is currently no regression test.
>
> Now to the questions.
>
> Were the function names (earth, sec_to_gc, gc_to_sec, ll_to_earth, latitude,
> longitude, earth_distance, and earth_box) acceptable?

Sure.

> Should I make a separate regression test file or add it on to the existing
> one for earth_distance?

No, just add.  If someone wants earth measurements, it should all be in
one place.

> Should I make a separate README file or just add stuff to the end of the
> existing REAMDE file?

Just add.

> Should I leave the grants in, leave that to the administrator or provide
> a separate script?

I would not add the grants.

> Should the creation of these functions be added to the existing script
> for earth_distance or should it be a separate script? It seems unlikely
> that someone would be using both of these at the same time, since one
> is based on the point type and the other on the cube type. However the
> overhead of installing both seems small, so maybe making it easier to
> try both and then pick one is worthwhile.


Install them both.  Just make sure it is clear which is which, or are
yours superior and the old one should be removed?

> Another option would be to go back to the contrib/cube install script
> and and grants for the functions there. And then just to a grant for
> the old geo_distance function in earthdistance (since that is the only
> 'C' function)? I didn't do that previously because the previous contrib/cube
> didn't, but of course, functions didn't have an execute privilege previously.
> If I do that, do I have to grant public access to internal functions
> (used for the gist index) or can I just make the ones meant for users
> to access directly public?

Not sure.  I don't think we want to public permit this stuff unless the
admin asks for it.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Making small bits of code available
Next
From: Stephan Szabo
Date:
Subject: Re: Fwd: "...integer[] references..." = error