#4585 closed (wontfix)
XMLField in PostgreSQL
Reported by: | BleSS | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | postgresql xmlfield | |
Cc: | gajon@…, adurdin@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I've seen that XMLField is really a TextField that checks if is valid XML:
http://www.djangoproject.com/documentation/model-api/#xmlfield
But PostgreSql has already a type designed for XML:
http://developer.postgresql.org/pgdocs/postgres/datatype-xml.html
http://developer.postgresql.org/pgdocs/postgres/functions-xml.html
and I think that the PostgreSQL backend would more powerfull if could use that type directly.
http://code.djangoproject.com/browser/django/trunk/django/db/backends/postgresql_psycopg2/introspection.py#L70
http://code.djangoproject.com/browser/django/trunk/django/db/models/fields/__init__.py#L943
Change History (2)
comment:1 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 18 years ago
It's true that XML data type only exists in certains builds of PostgreSQL, but it isn't hard to detect.
After of 5 min. in #postgresql channel (freenode):
\d pg_type select * from pg_type;
http://www.postgresql.org/docs/8.2/interactive/datatype-oid.html
The xml data type only exists on certain builds of PostgreSQL and not by default. For example, Fedora 7, using PostgreSQL 8.2.4 does not have this support. We can't have conditional field types based on what the database might or might not support in the server (it's very hard to detect and non-portable).
If somebody wants to use this functionality, they can create a field subclass (in the near future) that does what they want.