From: | Richard_D_Levine(at)raytheon(dot)com |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)postgresql(dot)org, pgsql-general-owner(at)postgresql(dot)org, Ronnie Meier Ramos <ronnie(at)viler(dot)com(dot)br> |
Subject: | Re: Global/persistent variables |
Date: | 2005-01-06 22:03:00 |
Message-ID: | OF5EFCAF7F.F2ABAC33-ON05256F81.0078A38A@ftw.us.ray.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I understand your pain, because PL/SQL is so close to plpgsql the functions
should just drop into quotes with renamed parameters, but they don't.
Using another language makes the port more difficult.
Have you considered functions that store the variable value in the database
and read it back from there? The functions would have to store variables
values by some kind of session or user ID so concurrent sessions wouldn't
trump one another. This would help with variable reference but variable
assignment would require more recoding.
There is also the issue of initializing sessions and cleaning up after
them. Not pretty.
Rick
Tom Lane
<tgl(at)sss(dot)pgh(dot)pa(dot)us> To: Ronnie Meier Ramos <ronnie(at)viler(dot)com(dot)br>
Sent by: cc: pgsql-general(at)postgresql(dot)org
pgsql-general-owner(at)pos Subject: Re: [GENERAL] Global/persistent variables
tgresql.org
01/06/2005 03:43 PM
Ronnie Meier Ramos <ronnie(at)viler(dot)com(dot)br> writes:
> AFAIK PG doesn't have packages - this is not a problem since I can
> handle it with different schemas or some naming convention, but is there
> a way to declare persistent variables (that would be "visible" to any
> function up to the end of the session) ?
plpgsql doesn't have this at present, but some of the other PLs do.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
From | Date | Subject | |
---|---|---|---|
Next Message | Bruno Wolff III | 2005-01-06 22:09:18 | Re: warning: pg_query(): Query failed |
Previous Message | Scott Ribe | 2005-01-06 21:58:12 | Re: Global/persistent variables |