This is a follow up to this question.
Here is my schema
CREATE TABLE A(
id serial NOT NULL,
date timestamp without time zone,
type text,
sub_type text,
filename text,
filepath text,
filesize integer,
lock_status int
);
In this database, a user can update the type,sub-type,filename,filepath,filesize as long as 'lock_status' is not set.
So, in the web page code (php) I can check the lock_status before updating the item.
However, there could be a case where another user has updated the lock status in the time between the first user's check & update.
So, is there a way in SQL to check the lock status before the row gets updated?
- webpage code is in php
- database is PostgreSQL
edit added type,sub-type to the editable field list above