[Django] #28116: Filtering PostgreSQL exception based on message is too brittle

21 views
Skip to first unread message

Django

unread,
Apr 22, 2017, 11:22:39 AM4/22/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude | Owner: nobody
Paroz |
Type: Bug | Status: new
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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`.

--
Ticket URL: <https://code.djangoproject.com/ticket/28116>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 22, 2017, 11:23:25 AM4/22/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* cc: felixxm (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:1>

Django

unread,
Apr 22, 2017, 11:29:31 AM4/22/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: felixxm
Type: Bug | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* owner: nobody => felixxm
* status: new => assigned
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:2>

Django

unread,
Apr 22, 2017, 11:35:30 AM4/22/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:3>

Django

unread,
Apr 23, 2017, 1:26:04 PM4/23/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

I found a way to check the PostgreSQL error code.

--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:4>

Django

unread,
Apr 23, 2017, 1:26:35 PM4/23/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/8396 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:5>

Django

unread,
Apr 24, 2017, 5:08:09 AM4/24/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:6>

Django

unread,
Apr 25, 2017, 12:01:47 AM4/25/17
to django-...@googlegroups.com
#28116: Filtering PostgreSQL exception based on message is too brittle
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: felixxm
Type: Bug | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"e776dd2db677d58dcb50aea20d3bb191537df25b" e776dd2d]:
{{{
#!CommitTicketReference repository=""
revision="e776dd2db677d58dcb50aea20d3bb191537df25b"
Fixed #28116 -- Used error code filtering in PostgreSQL test database
creation.

Thanks Claude Paroz and Tim Graham for reviews.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28116#comment:7>

Reply all
Reply to author
Forward
0 new messages