 |
|
 |
|
|
 |
Selects query inside function must read commited data |
 |
 |
|
|
 |
|
 |
|
|
 |
Re: Selects query inside function must read commited data |
 |
 |
|
|
 |
|
 |
|
|
 |
Re: Selects query inside function must read commited data |
 |
 |
|
|
01-25-04 08:35 AM
On Sun, 2004-01-25 at 08:51, V i s h a l Kashyap @ [Sai Hertz And
Control Systems] wrote:quote:
> Since sai_func_a() which encapsulates the function sai_func_b has not
> completed yet till #4 or #5
> then how does the function sai_func_b reads the new data since it is
> not committed yet.
>
> If I am not wrong PostgreSQL select statements works on committed data
> thus the new
> inserted data at #3 must not be available to sai_func_b() till #5
No. All operations by a single transaction are visible inside the
transaction. Therefore an encapsulated function can see anything already
done in the whole transaction. A function must be entirely inside a
transaction and cannot start a transaction, so there can never be any
problem about this.
Within a transaction, you cannot see data committed by any _other_
transaction that had not already committed when your transaction
started.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"My little children, let us not love in word, neither
in tongue; but in deed and in truth."
I John 3:18
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Selects query inside function must read commited data |
 |
 |
|
|
 |
|
 |
|
|
 |
Re: Selects query inside function must read commited data |
 |
 |
|
|
01-25-04 09:36 AM
On Sun, 2004-01-25 at 16:31, V i s h a l Kashyap @ [Sai Hertz And
Control Systems] wrote:quote:
> Dear Oliver Elphick ,
> Loads of thanks for the kind reply .
> Would be greatefull if you kindly post some links/refrences to support
> your answer for the said.
It's in the manual, somewhere; or try it and verify that what I say is
correct.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"My little children, let us not love in word, neither
in tongue; but in deed and in truth."
I John 3:18
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Selects query inside function must read commited data |
 |
 |
|
|
01-25-04 10:37 AM
In the v7.3 docs:
http://www.postgresql.org/docs/7.3/...MM
ITTED
/Read Committed/ is the default isolation level in PostgreSQL. When a
transaction runs on this isolation level, a SELECT query sees only data
committed before the query began; it never sees either uncommitted data
or changes committed during query execution by concurrent transactions.
(However, the SELECT does see the effects of previous updates executed
within its own transaction, even though they are not yet committed.) In
effect, a SELECT query sees a snapshot of the database as of the instant
that that query begins to run. Notice that two successive SELECTs can
see different data, even though they are within a single transaction, if
other transactions commit changes during execution of the first SELECT.
Andrew
V i s h a l Kashyap @ [Sai Hertz And Control Systems] wrote:
quote:
> Dear Oliver Elphick ,
>
> Loads of thanks for the kind reply .
> Would be greatefull if you kindly post some links/refrences to support
> your answer for the said.
> Thanks one again .
>
>
>--
>Regards,
>Vishal Kashyap
>
> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
~*~*~*~*
>I Know you believe my words so logon to Jabber.org
>and add vishalkashyap@jabber.org to your roster.
> OR
>Seek Me at 264360076
>~*~*~*~*~*~*~*~*
>I am usually called as Vishal Kashyap
>but my Girlfriend calls me as Vishal CASH UP.
>This is because others identify me because of my generosity
>but my Girlfriend identify me because of my CASH.
> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
~*~*~*~*
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Selects query inside function must read commited data |
 |
 |
|
|
01-26-04 06:36 AM
All this is well and good, but inside a function you might not see data
that is committed since the query snapshot is not updated within a
function. Search on setQuerySnapshot in the pgsql-bugs list and I think
you'll find more info. So far no one has come up with the evidence
needed to convince the core developers to change this behavior.
Robert Treat
On Sun, 2004-01-25 at 13:09, Andrew Biagioni wrote:quote:
> In the v7.3 docs:
>
> http://www.postgresql.org/docs/7.3/...n-iso.html#XACT
> -READ-COMMITTED
> <http://www.postgresql.org/docs/7.3/...on-iso.html#XAC
> T-READ-COMMITTED>
>
> Read Committed is the default isolation level in PostgreSQL. When a
> transaction runs on this isolation level, a SELECT query sees only data
> committed before the query began; it never sees either uncommitted data
> or changes committed during query execution by concurrent transactions.
> (However, the SELECT does see the effects of previous updates executed
> within its own transaction, even though they are not yet committed.) In
> effect, a SELECT query sees a snapshot of the database as of the instant
> that that query begins to run. Notice that two successive SELECTs can
> see different data, even though they are within a single transaction, if
> other transactions commit changes during execution of the first SELECT.
>
> Andrew
>
> V i s h a l Kashyap @ [Sai Hertz And Control Systems] wrote:
>
>
> Dear Oliver Elphick ,
>
>
> If I am not wrong PostgreSQL select statements works on committed data
>
> thus the new
>
> inserted data at #3 must not be available to sai_func_b() till #5
>
>
>
>
>
> No. All operations by a single transaction are visible inside the
>
> transaction. Therefore an encapsulated function can see anything already
>
> done in the whole transaction. A function must be entirely inside a
>
> transaction and cannot start a transaction, so there can never be any
>
> problem about this.
>
>
>
> Loads of thanks for the kind reply .
> Would be greatefull if you kindly post some links/refrences to support
> your answer for the said.
> Thanks one again .
>
>
>
> --
>
> Regards,
>
> Vishal Kashyap
>
>
>
> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
~*~*~*~*
>
> I Know you believe my words so logon to Jabber.org
>
> and add vishalkashyap@jabber.org <mailto:vishalkashyap@jabber.org> to
> your roster.
>
> OR
>
> Seek Me at 264360076
>
> ~*~*~*~*~*~*~*~*
>
> I am usually called as Vishal Kashyap
>
> but my Girlfriend calls me as Vishal CASH UP.
>
> This is because others identify me because of my generosity
>
> but my Girlfriend identify me because of my CASH.
>
> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
~*~*~*~*
>
>
>
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 09:03 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
|
 |
|
 |
|