Opened 7 years ago

Closed 7 years ago

#28116 closed Bug (fixed)

Filtering PostgreSQL exception based on message is too brittle

Reported by: Claude Paroz Owned by: Mariusz Felisiak
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Mariusz Felisiak Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In commit 64264c9a19b7dae6cd1d5e112177cdbcafafc93c, the behavior of _execute_create_test_db depends on the databae error message ''database %s already exists'.

On my system for example, the error message is localized so I'm finally getting a message Got an error creating the test database: la base de données « test_testgis1 » existe déjà even when I provide --keepdb.

Change History (7)

comment:1 by Claude Paroz, 7 years ago

Cc: Mariusz Felisiak added

comment:2 by Mariusz Felisiak, 7 years ago

Owner: changed from nobody to Mariusz Felisiak
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:3 by Claude Paroz, 7 years ago

What about just trying to check if the database exists when keepdb is True?

comment:4 by Mariusz Felisiak, 7 years ago

I found a way to check the PostgreSQL error code.

comment:5 by Mariusz Felisiak, 7 years ago

Has patch: set

comment:6 by Claude Paroz, 7 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by GitHub <noreply@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In e776dd2d:

Fixed #28116 -- Used error code filtering in PostgreSQL test database creation.

Thanks Claude Paroz and Tim Graham for reviews.

Note: See TracTickets for help on using tickets.
Back to Top