Mercurial > p > roundup > code
comparison roundup/backends/back_postgresql.py @ 3863:1d47f70a99bf
Seems like not all versions of postgres-drivers contain the string "ERROR"...
...in error-messages. In that case creating the database (when it
already exists) fails. This fixes the problem for me.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Thu, 09 Aug 2007 08:58:42 +0000 |
| parents | bb30bbfc7cdd |
| children | c8899c4bf6ad |
comparison
equal
deleted
inserted
replaced
| 3862:b052820e86bf | 3863:1d47f70a99bf |
|---|---|
| 1 #$Id: back_postgresql.py,v 1.38 2007-06-21 07:35:50 schlatterbeck Exp $ | 1 #$Id: back_postgresql.py,v 1.39 2007-08-09 08:58:42 schlatterbeck Exp $ |
| 2 # | 2 # |
| 3 # Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <andrey@micro.lt> | 3 # Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <andrey@micro.lt> |
| 4 # | 4 # |
| 5 # This module is free software, and you may redistribute it and/or modify | 5 # This module is free software, and you may redistribute it and/or modify |
| 6 # under the same terms as Python, so long as this copyright message and | 6 # under the same terms as Python, so long as this copyright message and |
| 77 cursor.execute(command) | 77 cursor.execute(command) |
| 78 except psycopg.ProgrammingError, err: | 78 except psycopg.ProgrammingError, err: |
| 79 response = str(err).split('\n')[0] | 79 response = str(err).split('\n')[0] |
| 80 if response.find('FATAL') != -1: | 80 if response.find('FATAL') != -1: |
| 81 raise RuntimeError, response | 81 raise RuntimeError, response |
| 82 elif response.find('ERROR') != -1: | 82 else: |
| 83 msgs = [ | 83 msgs = [ |
| 84 'is being accessed by other users', | 84 'is being accessed by other users', |
| 85 'could not serialize access due to concurrent update', | 85 'could not serialize access due to concurrent update', |
| 86 ] | 86 ] |
| 87 can_retry = 0 | 87 can_retry = 0 |
