16 ms·
Or if you can't afford to lock the table in the process, before you run UPDATE {foo} WHERE {bar} you back up the relevant rows into a temporary table with SELEC
by piaste 10y ago
Or if you can't afford to lock the table in the process, before you run UPDATE {foo} WHERE {bar} you back up the relevant rows into a temporary table with SELECT * INTO foo_backup WHERE {bar}.
- saurik 10y agoNone of this should cause a table lock: at best you will just lock the affected rows and at worst you will end up with a predicate lock on the where clause.
- scardine 10y agoPostgres uses MVCC (Multiversion concurrency control), it solves concurrency without locking everything you touch.