From: | Clemens Schwaighofer <clemens(dot)schwaighofer(at)e-graphics(dot)com> |
---|---|
To: | pasman pasmański <pasman(dot)p(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: plpgsql function with update and seeing changed data from outside during run |
Date: | 2011-06-09 09:28:57 |
Message-ID: | BANLkTinpWN_67cvCfODpE0j0=AbGhxxWHg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I can try this, but I have never done anything with plperl yet.
2011/6/9 pasman pasmański <pasman(dot)p(at)gmail(dot)com>:
> If you rewrite your function in plperlu , you can store data in shared memory.
>
> 2011/6/9, Clemens Schwaighofer <clemens(dot)schwaighofer(at)e-graphics(dot)com>:
>> Hi,
>>
>> I have a plpgsql function where I read data from a table in a loop and
>> update data in a different table.
>>
>> Is it possible to see the updated data from a different access during
>> the run of this function? Or is this impossible because the function
>> is a "transaction" and no data change is visible outside until the
>> function is finished? I can see the changed data inside the function.
>>
>> the function looks something like this
>>
>> create or replace function insert_log(i_log_id INT, i_queue_id INT)
>> returns "varchar"
>> as $$
>> declare
>> [... here are record, etc declarations]
>> begin
>> for myrec in select * from queue where queue_id = i_queue_id;
>> loop
>> insert into log_sub () values ();
>> update log set rows = [internal row count] where log_id = i_log_id;
>> end loop
>> end; $$ language plpgsql;
>> --
>> ★ Clemens 呉 Schwaighofer
>> ★ IT Engineer/Web Producer/Planning
>> ★ E-Graphics Communications SP Digital
>> ★ 6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN
>> ★ Tel: +81-(0)3-3545-7706
>> ★ Fax: +81-(0)3-3545-7343
>> ★ http://www.e-gra.co.jp
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>
> --
> ------------
> pasman
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
--
★ Clemens 呉 Schwaighofer
★ IT Engineer/Web Producer/Planning
★ E-Graphics Communications SP Digital
★ 6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN
★ Tel: +81-(0)3-3545-7706
★ Fax: +81-(0)3-3545-7343
★ http://www.e-gra.co.jp
From | Date | Subject | |
---|---|---|---|
Next Message | Sanjay Rao | 2011-06-09 09:45:57 | postgres server on windows with high availability and failover safe |
Previous Message | pasman pasmański | 2011-06-09 08:26:41 | Re: plpgsql function with update and seeing changed data from outside during run |