[Django] #24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is specified

17 views
Skip to first unread message

Django

unread,
Dec 25, 2014, 7:29:05 PM12/25/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
----------------------------------------------+----------------------------
Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.7
Severity: Normal | Keywords: Tablespace
| model
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+----------------------------
When DEFAULT_TABLESPACE is specified in the project settings.py using
database backend, django.db.backends.postgresql_psycopg2, the DDL does not
include the 'TABLESPACE' keyword, and the table is created in the default
PostgreSQL tablespace.

This does not affect the INDEX tablespace. The INDEXes are always created
in the correct tablespace (both with just DEFAULT_TABLESPACE and/or
DEFAULT_INDEX_TABLESPACE).

The patch is based off of Django 1.7.1.
I have attached a patch to correct this issue. It fixed the issue for me.

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

Django

unread,
Dec 26, 2014, 7:51:55 AM12/26/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
-------------------------------------+-------------------------------------

Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Tablespace model | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* severity: Normal => Release blocker
* needs_tests: => 1
* stage: Unreviewed => Accepted


Comment:

Could you add a test and release notes for 1.7.2? If you are able to send
a pull request on GitHub, that will ease testing and review, thanks.

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

Django

unread,
Dec 26, 2014, 12:35:32 PM12/26/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
-------------------------------------+-------------------------------------

Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Tablespace model | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by douglasjreynolds):

Replying to [comment:1 timgraham]:


> Could you add a test and release notes for 1.7.2? If you are able to
send a pull request on GitHub, that will ease testing and review, thanks.

I am attempting to get a pull request ready for you on GitHub. I am not
real familiar with GitHub, so bear with me.

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

Django

unread,
Dec 26, 2014, 8:53:22 PM12/26/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
-------------------------------------+-------------------------------------

Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Tablespace model | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by douglasjreynolds):

Replying to [comment:2 douglasjreynolds]:


> Replying to [comment:1 timgraham]:
> > Could you add a test and release notes for 1.7.2? If you are able to
send a pull request on GitHub, that will ease testing and review, thanks.
>
> I am attempting to get a pull request ready for you on GitHub. I am not
real familiar with GitHub, so bear with me.

I have put the code, tests, and documentation in pull request
https://github.com/django/django/pull/3796

After looking at the master branch, I saw that code had been included to
correct this issue. It looks like this was caused by the new
makemigration code in 1.7.

Let me know if you need anything else!

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

Django

unread,
Dec 27, 2014, 6:47:14 AM12/27/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
-------------------------------------+-------------------------------------

Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Tablespace model | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* needs_tests: 1 => 0


Comment:

Alternate patch without creating new tests:
https://github.com/django/django/pull/3798

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

Django

unread,
Dec 27, 2014, 8:51:59 AM12/27/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
-------------------------------------+-------------------------------------

Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: Tablespace model | 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 timgraham):

* stage: Accepted => Ready for checkin


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

Django

unread,
Dec 27, 2014, 9:12:50 AM12/27/14
to django-...@googlegroups.com
#24051: Tables are not created in specified tablespace when DEFAULT_TABLESPACE is
specified
-------------------------------------+-------------------------------------
Reporter: douglasjreynolds | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.7
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: Tablespace model | 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 <claude@…>):

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


Comment:

In [changeset:"322560489b2d2f873c7b8bd7799efd7cf80fb28b"]:
{{{
#!CommitTicketReference repository=""
revision="322560489b2d2f873c7b8bd7799efd7cf80fb28b"
[1.7.x] Fixed #24051 -- Made schema infrastructure honor tablespaces

Partial backport of 30cbd5d36. Thanks Douglas J. Reynolds for the
report and initial patch.
}}}

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

Reply all
Reply to author
Forward
0 new messages