Re: [HACKERS] Feature enhancement request : use of libg

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'Jan Wieck'" <janwieck(at)yahoo(dot)com>, jm(dot)poure(at)freesurf(dot)fr
Cc: Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgreSQL general list <pgsql-general(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Feature enhancement request : use of libg
Date: 2002-02-11 20:32:56
Message-ID: FED2B709E3270E4B903EB0175A49BCB104755D@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> -----Original Message-----
> From: Jan Wieck [mailto:janwieck(at)yahoo(dot)com]
> Sent: 11 February 2002 19:36
> To: jm(dot)poure(at)freesurf(dot)fr
> Cc: Andrew Sullivan; PostgreSQL general list;
> pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [GENERAL] [HACKERS] Feature enhancement request
> : use of libgda
>
>
> Jean-Michel POURE wrote:
> >
> > CREATE OR REPLACE VIEW / TRIGGER and ALTER TABLE DROP
> COLUMN are real
> > priorities for us at pgAdmin team
> (http://pgadmin.postgresql.org). I
> > don't know PostgreSQL internals, but it should take a few
> days/weeks
> > to an experienced hacker to add these features.
>
> Jean-Michel,
>
> I think you underestimate the problem a little.
>
> Doing CREATE OR REPLACE is not that trivial as you appear to
> think. The existing PL handlers (for PL/Tcl and PL/pgSQL at
> least) identify functions by their pg_proc OID. The
> functions body text is parsed only on the first call to that
> function during the entire session. So changing the functions
> prosrc attribute after having called it already wouldn't take
> effect until the next "session". But changing the OID as well
> corrupts existing SPI plans in other functions plus rules.
>
> Now it might be possible to tell your function handler to
> recompile that function at the next call without changing the
> OID, but how do you tell the function handlers in all the
> other concurrently running backends to do so after finishing
> their current transaction?

Bearing in mind that I know nearly nothing about internals here :), how
about storing a version number in pg_proc? CREATE OR REPLACE updates that,
and each backend notes it when first parsing the function. Future calls of
the function result in a check of the version, and re-parse if necessary.

I'm sure there's far more to this than I realise... :-)

Regards, Dave

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Michel POURE 2002-02-11 20:57:43 Re: [HACKERS] Feature enhancement request : use of libgda
Previous Message Mike Castle 2002-02-11 20:20:22 Re: what's the meaning of the word "Tioga" in source

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2002-02-11 20:57:43 Re: [HACKERS] Feature enhancement request : use of libgda
Previous Message noy 2002-02-11 20:29:28 Permissions problem