Search Postgresql Archives

Re: table as log (multiple writers and readers)

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

 



brian wrote:

Use a timestamp column also.

That's subject to the same issues, because a transaction's current_timestamp() is determined at transaction start. So, in a situation like this:


WRITER 1    WRITER 2    READER 1
--------------------------------------------
BEGIN
            BEGIN
INSERT
            INSERT
            COMMIT
                        BEGIN
                        SELECT
COMMIT

then READER 1 will see the most recent timestamp as that inserted by WRITER 2, but it won't see the row inserted by WRITER 1 with an earlier timestamp.

I don't think it's even OK in the case of a single-statement INSERT (where the transaction is implicit) and/or with the use of clock_timestamp() ... though I'm less sure about that.

--
Craig Ringer


[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