sorry my last mail went incomplete
please read through this and ignore my last mail
paraM
 
----- Forwarded by Paramveer Singh/Trilogy on 20/09/2004 05:21 PM -----


Paramveer Singh
20/09/2004 05:56 PM

 
        To:     pgsql-hackers@postgresql.org
        cc: 
        Subject:        schema level variables and deferrable unique constraints

hi!
I apologize for mailing on the hackers list but I posted on the general 
list and did not get a good answer.
I have two independent issues, but am addressing them together.

1.
Oracle has package level variables which are not mappable to any postgres 
equivalent.
could we have something like schema scope variables which could be 
directly referred from let's say plpgsql functions?
Can someone give me some pointers on how to go about implementing this?

2.
Postgres does not support deferrable unique constraints.
we would however like to support this especially as some updates give 
non-standard behavior because of this.
where do I start reading up on what all needs to be done to support this?
I have no idea about the postgres codebase. I only understand the 
implementation of the plpgsql library.
Any pointers on where to start would be helpful

thanks
paraM

sorry my last mail went incomplete
please read through this and ignore my last mail
paraM
 
----- Forwarded by Paramveer Singh/Trilogy on 20/09/2004 05:21 PM -----




Paramveer Singh
20/09/2004 05:56 PM

        
        To:        pgsql-hackers@postgresql.org
        cc:        
        Subject:        schema level variables and deferrable unique constraints

hi!
I apologize for mailing on the hackers list but I posted on the general list and did not get a good answer.
I have two independent issues, but am addressing them together.

1.
Oracle has package level variables which are not mappable to any postgres equivalent.
could we have something like schema scope variables which could be directly referred from let's say plpgsql functions?
Can someone give me some pointers on how to go about implementing this?

2.
Postgres does not support deferrable unique constraints.
we would however like to support this especially as some updates give non-standard behavior because of this.
where do I start reading up on what all needs to be done to support this?
I have no idea about the postgres codebase. I only understand the implementation of the plpgsql library.
Any pointers on where to start would be helpful

thanks
paraM
Mon, 20 Sep 2004 17:59:32 +0630
Paramveer.Singh@trilogy.com
schema level variables and deferrable unique constraints
Paramveer.Singh@trilogy.com writes:
> Oracle has package level variables which are not mappable to any postgres 
> equivalent.
> could we have something like schema scope variables which could be 
> directly referred from let's say plpgsql functions?
> Can someone give me some pointers on how to go about implementing this?

It seems more appropriate to me to store your values in a table
(variable name and value).  I don't see any strong need for a
system-level facility for this.

			regards, tom lane

Mon, 20 Sep 2004 10:34:33 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: schema level variables and deferrable unique constraints 
Tom Lane wrote:
> Paramveer.Singh@trilogy.com writes:
> 
>>Oracle has package level variables which are not mappable to any postgres 
>>equivalent.
>>could we have something like schema scope variables which could be 
>>directly referred from let's say plpgsql functions?
>>Can someone give me some pointers on how to go about implementing this?
> 
> 
> It seems more appropriate to me to store your values in a table
> (variable name and value).  I don't see any strong need for a
> system-level facility for this.
> 
Package variables are not transactional, additionaly they are
session based - each session has it's own variables(values).
You can assign initial(defult) values in package spec.
Using table for them would also imply several columns
for each datatype or several tables for them.

Andre

Mon, 20 Sep 2004 20:08:39 +0300
Andre <andre@abs.ee>
Re: schema level variables and deferrable unique constraints
Andre wrote:
> Package variables are not transactional, additionaly they are
> session based - each session has it's own variables(values).
> You can assign initial(defult) values in package spec.
> Using table for them would also imply several columns
> for each datatype or several tables for them.

I did a crude implementation of session variables for my OSCON tutorial 
which can be found here:
   http://www.joeconway.com/tut_oscon_2004.pdf
See the slides with myfunc_setvar(), myfunc_getvar(), and myfunc_rmvar().

I have a slightly improved version that I'm using on a production system 
with good results. You can get the tarball here:

http://www.joeconway.com/pgsession.tar.gz

There was another implementation of session variables based on shared 
memory floating around the lists somewhere. You might try searching the 
archives for that also.

HTH,

Joe

Mon, 20 Sep 2004 10:55:56 -0700
Joe Conway <mail@joeconway.com>
Re: schema level variables and deferrable unique constraints


Joe Conway wrote:

> Andre wrote:
>
>> Package variables are not transactional, additionaly they are
>> session based - each session has it's own variables(values).
>> You can assign initial(defult) values in package spec.
>> Using table for them would also imply several columns
>> for each datatype or several tables for them.
>
>
> I did a crude implementation of session variables for my OSCON 
> tutorial which can be found here:
>   http://www.joeconway.com/tut_oscon_2004.pdf
> See the slides with myfunc_setvar(), myfunc_getvar(), and myfunc_rmvar().
>
> I have a slightly improved version that I'm using on a production 
> system with good results. You can get the tarball here:
>
> http://www.joeconway.com/pgsession.tar.gz
>
> There was another implementation of session variables based on shared 
> memory floating around the lists somewhere. You might try searching 
> the archives for that also.
>
>

In 8.0 plperl has %_SHARED, which is essentially a stash for 
session-persistent data of arbitrary complexity. It's one of the new 
features. Writing get/set functions for them would be entirely trivial. 
Seeding them with inital defaults would involve an explicit function 
call at session startup - we don't have that automated for plperl yet.

cheers

andrew

Mon, 20 Sep 2004 14:11:35 -0400
Andrew Dunstan <andrew@dunslane.net>
Re: schema level variables and deferrable unique constraints