Re: RFD: schemas and different kinds of Postgres objects

From: Bill Studenmund <wrstuden(at)netbsd(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>, Fernando Nasser <fnasser(at)redhat(dot)com>
Subject: Re: RFD: schemas and different kinds of Postgres objects
Date: 2002-01-24 19:50:12
Message-ID: Pine.NEB.4.33.0201241147131.9384-100000@vespasia.home-net.internetconnect.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 24 Jan 2002, Peter Eisentraut wrote:

> Bill Studenmund writes:
>
> > Does SQL'99 say anything about this?
>
> Yes, though, as usual, you have to twist your brain a little to understand
> it.

Indeed. I find the spec makes the most sense after you understand it. ;-)

> My understanding is that for a function call of the form "foo(a, b)"
> it goes like this:
>
> 1. Find all functions named "foo" in the current database. This is the
> set of "possibly candidate routines".
>
> 2. Drop all routines that you do not have EXECUTE privilege for. This is
> the set of "executable routines".
>
> 3. Drop all routines that do not have compatible parameter lists. This is
> the set of "invocable routines".
>
> 4. Drop all routines whose schema is not in the path. This is the set of
> "candidate routines".
>
> 5. If you have more than one routine left, eliminate some routines
> according to type precedence rules. (We do some form of this, SQL99
> specifies something different.) This yields the set of "candidate subject
> routines".
>
> 6. Choose the routine whose schema is earliest in the path as the "subject
> routine".
>
> Execute the subject routine. Phew!

Wow. Thanks for diging this out.

> This doesn't look glaringly wrong to me, so maybe you want to consider it.
> Please note step 2.

It looks fine, and is probably what we should do. Well, I'd do things in a
different order (look only in in-path schemas first for instance), but
that's just trying to optimize the query. :-)

How different are the type coercion rules?

Take care,

Bill

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-01-24 19:53:37 Re: autoconf + newer gcc barfs
Previous Message Trond Eivind Glomsrød 2002-01-24 19:47:12 Re: C++ problems with RC1