Re: Logical locking beyond pg_advisory

2018-09-17 Thread marcelo
On 17/09/2018 14:27 , Chris Travers wrote: On Mon, Sep 17, 2018 at 6:04 PM marcelo > wrote: I´m using an ORM (Devart´s) to access the database, so, I cannot "select ... FOR UPDATE". The application paradigm is that a user have a list of

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Chris Travers
On Mon, Sep 17, 2018 at 6:04 PM marcelo wrote: > > > I´m using an ORM (Devart´s) to access the database, so, I cannot "select > ... FOR UPDATE". The application paradigm is that a user have a list of > records (after a query) and she could update or delete any of them as the > business rules

Re: Logical locking beyond pg_advisory

2018-09-17 Thread marcelo
On 17/09/2018 12:21 , Chris Travers wrote: On Mon, Sep 17, 2018 at 5:09 PM Merlin Moncure > wrote: On Sun, Sep 16, 2018 at 3:53 PM marcelo mailto:marcelo.nico...@gmail.com>> wrote: > > I need a mechanism of "logical locking" more ductile than the

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Chris Travers
On Mon, Sep 17, 2018 at 5:09 PM Merlin Moncure wrote: > On Sun, Sep 16, 2018 at 3:53 PM marcelo wrote: > > > > I need a mechanism of "logical locking" more ductile than the > pg_advisory family. > > I'm thinking of a table ("lock_table") that would be part of the > database, with columns > > *

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Merlin Moncure
On Sun, Sep 16, 2018 at 3:53 PM marcelo wrote: > > I need a mechanism of "logical locking" more ductile than the pg_advisory > family. > I'm thinking of a table ("lock_table") that would be part of the database, > with columns > * tablename varchar - name of the table "locked" > * rowid

Re: Logical locking beyond pg_advisory

2018-09-17 Thread marcelo
/Would be nice if you explain more about what kind of problem you want to solve./ There are two main questions "to solve" a) generally speaking, I like to get some form of "exclusive access" to the row before updating or deleting. None of the optimistic / pesimistic automatic variants of

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Fabrízio de Royes Mello
Em dom, 16 de set de 2018 às 17:53, marcelo escreveu: > > I need a mechanism of "logical locking" more ductile than the pg_advisory family. > I'm thinking of a table ("lock_table") that would be part of the database, with columns > * tablename varchar - name of the table "locked" > * rowid

Logical locking beyond pg_advisory

2018-09-16 Thread marcelo
I need a mechanism of "logical locking" more ductile than the pg_advisory family. I'm thinking of a table ("lock_table") that would be part of the database, with columns * tablename varchar - name of the table "locked" * rowid integer, - id of the row "locked" * ownerid varchar, - identifier of