![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
On Sat, Dec 16, 2006 at 5:15 PM, in message 8738.1166310917 (AT) sss (DOT) pgh.pa.us>, |
|
"" <martin.pihlak (AT) gmail (DOT) com> writes: Prepared SELECT/UPDATE/DELETE statements produce wrong results if executed while target table is being clustered. The short answer is "don't CLUSTER while the table is in live use" .... CLUSTER re- inserts all the rows in the table into a fresh table. This means that all the rows appear to have been inserted by the CLUSTER transaction, and therefore that a transaction that scans the table afterward with a snapshot taken before the CLUSTER committed will not see those rows. |
|
The difference between EXECUTE and SELECT behavior here is just a chance matter of exactly where the snap is taken during the parse/execute code path --- your SELECT works because it blocks for AccessShareLock on the table before it sets the snap. But SELECT would fail just the same way within a serializable transaction that had already set its snapshot. |
![]() |
| Thread Tools | |
| Display Modes | |
| |