Opened 13 years ago

Last modified 6 weeks ago

#20960 assigned New feature

DEFAULT_TABLESPACE should be part of DATABASES

Reported by: Anssi Kääriäinen Owned by: Alok Raj
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: django@…, bcail Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Currently DEFAULT_TABLESPACE is settings global. Of course, this short of thing is better set per-database. So, lets move DEFAULT_TABLESPACE and DEFAULT_INDEX_TABLESPACE to DATABASES['some_alias']['OPTIONS'].

This also allows those databases that do not support tablespaces to throw errors if tablespace is defined in options.

Attachments (1)

Screenshot (573).png (235.7 KB ) - added by Alok Raj 6 weeks ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Shai Berger, 12 years ago

Why in OPTIONS, and not in the main dictionary?

My understanding is that OPTIONS is for backend-specific parameters.

comment:2 by Aymeric Augustin, 12 years ago

Well, it depends if tablespaces are a standard concept in SQL (eg. mentioned in the ISO standard) or just something that happens to be implemented by several databases.

Version 0, edited 12 years ago by Aymeric Augustin (next)

comment:3 by no, 12 years ago

Cc: django@… added

comment:4 by bcail, 2 years ago

Cc: bcail added
Has patch: set
Owner: changed from nobody to bcail
Status: newassigned

I opened a draft PR.

Some test runs are failing with the following error:
django.utils.deprecation.RemovedInDjango60Warning: The DEFAULT_TABLESPACE setting is deprecated.
How should I handle that error with the deprecated settings?

comment:5 by Mariusz Felisiak, 2 years ago

Patch needs improvement: set

comment:6 by bcail, 16 months ago

Owner: bcail removed
Status: assignednew

comment:7 by Alok Raj, 6 weeks ago

I am planning to work further to improve the existing patch in PR #17902 by resolving the merge conflicts with current main and addressing the remaining test failures related to deprecation warnings.

Last edited 6 weeks ago by Alok Raj (previous) (diff)

comment:8 by Alok Raj, 6 weeks ago

Has patch: unset
Owner: set to Alok Raj
Status: newassigned

comment:9 by Alok Raj, 6 weeks ago

Has patch: set

My draft PR:- https://github.com/django/django/pull/20547
I have worked on the existing patch and fixed premature DEFAULT_TABLESPACE deprecation warnings by making them lazy and updating the warning class to RemovedInDjango70Warning. But PostgreSQL and PostGIS tests are failing and giving an error 0 != 2 : Found 0 instances of 'default_tablespace', expected 2. I tried some attempts to fix them but I was not succeed.
Would you help me regarding solving the error?

Last edited 6 weeks ago by Alok Raj (previous) (diff)

by Alok Raj, 6 weeks ago

Attachment: Screenshot (573).png added
Note: See TracTickets for help on using tickets.
Back to Top