Search Postgresql Archives

Re: what's the exact command definition in read committed isolation level?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jinhua Luo schrieb am 18.04.2016 um 16:47:
> For trigger, e.g. written in pl/pgsql, each sql command within the
> function may see more new data beyond the (entry) snapshot of outer
> command.

No it will not see "more data")

It runs in the same _transaction_ as the "firing" command and thus sees 
**exactly** the same data as the triggering statement

> So if the "command" term in the read committed isolation level only
> refers to outer command (the outer command is the top level command
> send by session client), then it's wrong obviously, so it should
> clarify that the trigger is an rule exception, in other words, the
> commands in trigger should be considered as virtual "outer" commands,
> just like you inline the trigger body below the outer command.

The visibility of data with regards to isolation levels is all about _transactions_ - **not** statements. 

Just because you run in auto-commit mode doesn't mean this changes. 

With autocommit enabled, the first (or outer) statement starts a _transaction_ and that transaction only ends when **that** statement is finished. 

Any statement that is execute because e.g. a trigger is fired or the statement calls a function that contains several statements is still part of that _transaction_. 

Thomas




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux