[GENERAL] Is the row version available in SQL? - Mailing list pgsql-general

From Rob Nikander
Subject [GENERAL] Is the row version available in SQL?
Date
Msg-id 2558AA7C-1FF0-4BBC-8160-BF9DD41CCD0C@gmail.com
Whole thread Raw
Responses Re: [GENERAL] Is the row version available in SQL?  (Chris Travers <chris.travers@gmail.com>)
Re: [GENERAL] Is the row version available in SQL?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hi,


In some cases I can use these transaction isolation modes, but in other cases, I may want to manage the versions and concurrency manually. Is there a way to select the “version” of a row, or is that data hidden to ordinary SQL statements?

I’m thinking about a sequence of actions, which are logically a transaction, but start on one thread and complete later on another thread. I don’t think I can tie up a JDBC database connection for that long. I can add a `version bigint` column to my table, and the final update will look like:

     update ... where id = ? and version = the_version_selected_earlier_in_a_different_thread

… and if that gets 0 rows, it can handle the conflict.

Rob


pgsql-general by date:

Previous
From: gmb
Date:
Subject: Re: [GENERAL] CREATE TABLE & composite type
Next
From: Chris Travers
Date:
Subject: Re: [GENERAL] Is the row version available in SQL?