Row versioning

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ruediger Herrmann

    #1

    Row versioning

    Hi all,

    has anyone implemented row versions/timestamps in PostgreSQL or any
    thoughts on this?
    Did I hit the right term? What I want to achieve is optimistic
    concurrency beyound transaction boundaries. When retrieving data
    I would also retrieve the row version and later on, in a different
    transaction, before updating the data, I could check if was unchanged.
    (row version at read time = row version at update time)

    What are the pro's and con's about adding a "sequence" row that is
    incremented by a trigger each time the row is updated?
    Is having a timestamp row instand better?

    Regards
    Ruediger


    --
    Geschenkt: 3 Monate GMX ProMail + 3 Ausgaben der TV Movie mit DVD
    ++++ Jetzt anmelden und testen http://www.gmx.net/de/go/mail ++++


    ---------------------------(end of broadcast)---------------------------
    TIP 8: explain analyze is your friend

  • Tom Lane

    #2
    Re: Row versioning

    "Ruediger Herrmann" <ruediger.herrm ann@gmx.de> writes:[color=blue]
    > has anyone implemented row versions/timestamps in PostgreSQL or any
    > thoughts on this?
    > Did I hit the right term? What I want to achieve is optimistic
    > concurrency beyound transaction boundaries. When retrieving data
    > I would also retrieve the row version and later on, in a different
    > transaction, before updating the data, I could check if was unchanged.[/color]

    You could use the xmin system column for this.

    regards, tom lane

    ---------------------------(end of broadcast)---------------------------
    TIP 7: don't forget to increase your free space map settings

    Comment

    Working...