Re: [rfc] new CREATE FUNCTION (and more)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [rfc] new CREATE FUNCTION (and more)
Date: 2000-11-17 04:07:12
Message-ID: 11554.974434032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> So long as the version is always in the first bytes of the struct, we are
> covered for compatibility.

Right ...

> I'd still argue for a PG_FUNCTION_API_V2 macro for the reasons above. What
> the fmgrs needs to do is:

> - call pg_fmgr_api_version() to get the protocol version
> - when it wants to call a function 'foo' see if there is a 'pg_api_foo'
> entry point, and if so, use the new interface, o/wise use the old one. No
> need to even call it.

This strikes me as completely backwards, because it prejudges an
assumption that protocol decisions can be made on a library-wide basis.
I see no need for a library-wide protocol definition. What I want to
do is call 'pg_api_foo' (if it exists) to find out all about the
function 'foo', without any restriction on whether 'foo' is like 'bar'
that happens to have been linked into the same shlib.

The test to see if 'pg_api_foo' exists is going to be the expensive
part of this anyway. Once you've done that, you may as well call it...

> My only real issue with all of this is that we need to separate the
> protocol selection from the the data exchange.

Negotiating a protocol to negotiate protocol strikes me as considerable
overkill. It should be plenty sufficient to say that a parameterless
function with a determinable name will hand back a struct whose first
word identifies the contents of the struct. Why do we need another
layer on top of that? Especially if it's a layer that makes the
unsupported assumption that all functions in a given shlib are similar?
That way reduces flexibility, rather than increasing it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Schmidt, Peter 2000-11-17 04:21:57 Hung backends
Previous Message Philip Warner 2000-11-17 03:49:56 Re: [rfc] new CREATE FUNCTION (and more)