Re: FWD: Re: Updated backslash consistency patch

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: FWD: Re: Updated backslash consistency patch
Date: 2009-01-16 03:28:25
Message-ID: 20090116032824.GS4656@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Stephen Frost <sfrost(at)snowman(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-16 03:31:39 Re: FWD: Re: Updated backslash consistency patch
Previous Message Fujii Masao 2009-01-16 03:18:38 Re: BUG #4566: pg_stop_backup() reports incorrect STOP WAL LOCATION