Re: proposal for PL packages for 8.3. - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal for PL packages for 8.3.
Date
Msg-id BAY20-F14D617E0D1147699FAA348F9550@phx.gbl
Whole thread Raw
In response to Re: proposal for PL packages for 8.3.  (Richard Huxton <dev@archonet.com>)
Responses Re: proposal for PL packages for 8.3.
List pgsql-hackers
>There are three separate issues we seem to be talking about.
>
>1. Namespaces - visibility or otherwise of objects
>2. Procedural state - something that looks like a shared variable
>3. Packaging - installation/dependency handling
>
and 4. support more languages:
4a) binary incompatibility between variables different PL
4b) two types for calling functions [native and SPI]

>Namespaces
>Given that we already have search_path it makes sense to use it. So, we 
>could have something like:
>1. A "PRIVATE" modifier for objects that mean they are only accessible if 
>their schema is the first in the search_path.
>2. A definable search_path for a schema, so all objects have that setting 
>by default. In theory, this could break dynamic queries in functions that 
>relied on a changeable search_path.
>
>Procedural state
>Just a convenient way of defining some small amount of state. Will need 
>session variables and static shared variables. Presumably we'll need to be 
>able to lock shared variables.
>
>Packaging
>I'd guess we'd need a pg_package and pg_package_items system tables. We 
>could track:
>- package name (different from schema)
>- version number
>- install/uninstall functions
>- start-session/end-session functions
>- dependencies (is pg_depend enough)
>pg_package_items
>- schema-name
>- variables, functions, tables, views etc
>
it's strong but little bit complicated system.  Start session and end 
session is better to solve via session's triggers. Install, uninstall, +/- I 
can understand sence, but I can call it manually. I need loader of package 
which is evaluated when somebody first call any function from package. This 
loader can initialize and create package variables (Perl don't has 
variable's declaration).  Can somebody say what is ANSI SQL? I haven't text 
of it :-(. I found only basic syntax of "CREATE MODULE".

I thinking abaut session or schema variables. Which solve some kind of 
problems. It's need some changes in parser, and part of code plpgsql can be 
moved into parser.

Pavel

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci. 
http://messenger.msn.cz/



pgsql-hackers by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: An Idea for planner hints
Next
From: "Florian G. Pflug"
Date:
Subject: Re: An Idea for planner hints