dbTalk Databases Forums  

Row versioning

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Row versioning in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ruediger Herrmann
 
Posts: n/a

Default Row versioning - 10-21-2004 , 05:27 PM






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


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: Row versioning - 10-21-2004 , 06:33 PM






"Ruediger Herrmann" <ruediger.herrmann (AT) gmx (DOT) de> writes:
Quote:
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.
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



Reply With Quote
  #3  
Old   
Ruediger Herrmann
 
Posts: n/a

Default Re: Row versioning - 10-22-2004 , 08:16 AM




thanks for your replay. This approach sounds very comfy. As I read the
documentation this is kind of a "transaction sequence" or better a
"unique transaction id". Am I right with this? So every row inserted or
updated within the same transaction is tagged with the same xmin.

Is there any information wether this approach is future proof? I heard
the OID is depecated now, maybe XMIN is next, no idea...

TIA
Ruediger


Quote:
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.

You could use the xmin system column for this.

regards, tom lane



--
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 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: Row versioning - 10-22-2004 , 09:18 AM



"Ruediger Herrmann" <ruediger.herrmann (AT) gmx (DOT) de> writes:
Quote:
Is there any information wether this approach is future proof?
[ shrug... ] As much as anything that's not specified by the SQL
standard is around here. We have no plans to replace MVCC, and
xmin/xmax are a pretty fundamental part of that.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.