rdbms: define wasLockTimeout() for postgres
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 20 Mar 2018 01:08:37 +0000 (18:08 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 20 Mar 2018 01:08:37 +0000 (18:08 -0700)
Change-Id: Ic54530f0b48fb3e3a42c1e6e95a5a75c6b5c061d

includes/libs/rdbms/database/DatabasePostgres.php

index 7b2ef83..49c945e 100644 (file)
@@ -799,7 +799,13 @@ __INDEXATTR__;
        }
 
        public function wasDeadlock() {
-               return $this->lastErrno() == '40P01';
+               // https://www.postgresql.org/docs/8.2/static/errcodes-appendix.html
+               return $this->lastErrno() === '40P01';
+       }
+
+       public function wasLockTimeout() {
+               // https://www.postgresql.org/docs/8.2/static/errcodes-appendix.html
+               return $this->lastErrno() === '55P03';
        }
 
        public function duplicateTableStructure(