Re: FWD: Re: Updated backslash consistency patch - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: FWD: Re: Updated backslash consistency patch
Date
Msg-id 20090116032824.GS4656@tamriel.snowman.net
Whole thread Raw
In response to Re: FWD: Re: Updated backslash consistency patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: FWD: Re: Updated backslash consistency patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > On a seperate (kind of) note, I'd really like to be able to say "I want
> > this function visible everywhere" like a system function.
>
> Huh?  System functions don't have that property either.

Perhaps I'm missing something, or it was a poor choice of words,
but:

postgres=> show search_path; search_path
----------------"$user",public
(1 row)

postgres*=> \df abstime
...pg_catalog | abstime | abstime          | timestamp without time zone
...

postgres*=> select abstime('2008-10-10');       abstime
------------------------2008-10-10 00:00:00-04
(1 row)

Regardless of what I reset my search_path to, I'm going to have access
to abstime.  Is there something else special about it besides being
a 'system function' and being in pg_catalog to make it always available
regardless of my search_path?

> You could do that today with a quick hack on your default search path,
> though: set search_path = global, pg_catalog, public or something like
> that (... and be *very* careful about what you put in schema "global").

I reset my search_path all the time going between different tasks,
different projects, etc, and it gets really annoying to have to include
', public;' every time I want to use a PostGIS function in my 'gis'
database.  That's primairly what's driving this comment, and the fact
that I tend to like keeping the 'public' schema pristine.  I would find
it much cleaner if I could drop my PostGIS functions in a 'postgis'
schema but still mark the public ones as being always available somehow.

I've got lots of functions in other schemas where I *don't* want them
globally available too, of course.  And it should be something at the
level of database-owner or similar to declare functions in such a way.

The point there being that PostGIS is really an extension or a
module that, if all the stars aligned, might be part of the system
catalog some day (or the same functionality at any rate).  Until then,
I'd like the ability to mimic it more closely than I can today.  The
other fact being that it feels dirty to me to have to put any function
that I want globally available into the 'public' schema, thus
mish-mashing them together into one area.

I've lived with it for as long as I've been using PostGIS though, so
it's not exactly a show stopper.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch
Next
From: Tom Lane
Date:
Subject: Re: FWD: Re: Updated backslash consistency patch