Changes between Initial Version and Version 1 of Ticket #30375


Ignore:
Timestamp:
Apr 16, 2019, 4:20:31 PM (5 years ago)
Author:
Manuel Weitzman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30375

    • Property Version 1.112.2
  • Ticket #30375 – Description

    initial v1  
    1313which can be easily done by overriding BaseOperation.for_update_sql in Postgres DatabaseOperation
    1414
    15 
     15For 1.11
    1616{{{
    1717def for_update_sql(self, nowait=False, skip_locked=False):
     
    2727}}}
    2828
     29For 2.2
     30
     31{{{
     32def for_update_sql(self, nowait=False, skip_locked=False, of=()):
     33    """
     34    Return the FOR UPDATE SQL clause to lock rows for an update operation.
     35    """
     36    return 'FOR NO KEY UPDATE%s%s%s' % (
     37        ' OF %s' % ', '.join(of) if of else '',
     38        ' NOWAIT' if nowait else '',
     39        ' SKIP LOCKED' if skip_locked else '',
     40    )
     41}}}
     42
     43
    2944Not doing so causes lock contention in our use case.
Back to Top