summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/base.py
AgeCommit message (Collapse)Author
2010-06-07[soc2010/query-refactor] Altered the base database backend class to not have ↵Alex Gaynor
anything more than the bare minimum. Also add the bare beginnings for a mongodb backend. git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-25Fixed #12766 -- Only set the psycopg1 client encoding when the connection is ↵Russell Keith-Magee
first created. This allows the custom_pk test to pass under psycopg1. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12848 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-25Fixed #12759 -- Fixed the iterator method on psycopg1 cursors, which was ↵Russell Keith-Magee
preventing the raw_query tests from passing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-26Corrected an edge case introduced in r12602. Thanks to Ramiro Morales for ↵Russell Keith-Magee
the eagle eyes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12605 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-26Fixed #1480 -- Added the ability to use the system timezone. Thanks to ↵Russell Keith-Magee
Ramiro Morales for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23No, really this time -- corrected the warning message from r12510.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12512 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23Cleaned up the warning message introduced by r12510.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23Fixed #12912 -- Placed the psycopg1-backed ``postgresql`` database backend ↵Russell Keith-Magee
on the deprecation path. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-03Fixed a regression in the Postgres psycopg cursor handling introduced by ↵Russell Keith-Magee
r12352. Thanks to Kenneth Gonsalves for the report, and Karen for the fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-30Fixed #12732 -- Corrected an argument naming problem introduced by r12532. ↵Russell Keith-Magee
Thanks to stevedegrace for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-29Fixed #12702 -- Introduced a common implementation of DatabaseError and ↵Russell Keith-Magee
IntegrityError, so that database backends can (re)raise common error classes. Thanks for Waldemar Kornewald for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #1142 -- Added multiple database support.Russell Keith-Magee
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project. Congratulations to Alex for a job well done. Big thanks also go to: * Justin Bronn for keeping GIS in line with the changes, * Karen Tracey and Jani Tiainen for their help testing Oracle support * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback. * Malcolm Treddinick for his guidance during the GSoC submission process. * Simon Willison for driving the original design process * Cal Henderson for complaining about ponies he wanted. ... and everyone else too numerous to mention that helped to bring this feature into fruition. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-11Corrected PostgreSQL version comparisons from r10730. Thanks to rozwell for ↵Russell Keith-Magee
the report on IRC. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10735 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10Fixed #10842 -- Corrected parsing of version numbers for PostgreSQL 8.4beta ↵Russell Keith-Magee
series. Thanks to hgdeoro for the report and fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-29Fixed #6064 -- Added the `connection_created` signal for when a database ↵Justin Bronn
connection is created. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10182 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11Fixed #10459 -- Refactored the internals of database connection objects so ↵Adrian Holovaty
that connections know their own settings and pass around settings as dictionaries instead of passing around the Django settings module itself. This will make it easier for multiple database support. Thanks to Alex Gaynor for the initial patch. This is backwards-compatible but will likely break third-party database backends. Specific API changes are: * BaseDatabaseWrapper.__init__() now takes a settings_dict instead of a settings module. It's called settings_dict to disambiguate, and for easy grepability. This should be a dictionary containing DATABASE_NAME, etc. * BaseDatabaseWrapper has a settings_dict attribute instead of an options attribute. BaseDatabaseWrapper.options is now BaseDatabaseWrapper['DATABASE_OPTIONS'] * BaseDatabaseWrapper._cursor() no longer takes a settings argument. * BaseDatabaseClient.__init__() now takes a connection argument (a DatabaseWrapper instance) instead of no arguments. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28Fixed #8592 -- Fixed a bug in the way savepoint usage was disabled forMalcolm Tredinnick
PostgreSQL < 8.0. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25Fixed #3575: use UPPER() instead ILIKE for postgres case-insensitive ↵Jacob Kaplan-Moss
comparisons. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12Do not use savepoints with PostgreSQL prior to 8.0.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12Added savepoint support to the transaction code.Malcolm Tredinnick
This is a no-op for most databases. Only necessary on PostgreSQL so that we can do things which will possibly intentionally raise an IntegrityError and not have to rollback the entire transaction. Not supported for PostgreSQL versions prior to 8.0, so should be used sparingly in internal Django code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11Fixed #5461 -- Refactored the database backend code to use classes for the ↵Russell Keith-Magee
creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17Fixed #5883 -- Added __iter__ methods to the debug cursor and the postgresql ↵Malcolm Tredinnick
backend cursor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7259 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-25Changed postgresql and postgresql_psycopg2 backends NOT to do a SELECT ↵Adrian Holovaty
version() for every connection, which was ludicrous. Now the version is only retrieved if it needs to be, via a lazy loader. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Made various negligible formatting cleanups to the database backendsAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored OPERATOR_MAPPING so that it exists as ↵Adrian Holovaty
django.db.connection.operators instead of django.db.backend.OPERATOR_MAPPING. Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Implemented BaseDatabaseFeatures and changed all code to access it -- ↵Adrian Holovaty
connection.features.foo instead of backend.foo git-svn-id: http://code.djangoproject.com/svn/django/trunk@5974 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Moved postgresql backend DatabaseOperations class into a new module, ↵Adrian Holovaty
postgresql/operations.py, so that it can be imported by both the postgresql and postgresql_psycopg2 backends. Hence the two backends no longer have a duplicated DatabaseOperations class git-svn-id: http://code.djangoproject.com/svn/django/trunk@5972 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Removed backend.dictfetchall(), as it wasn't being used anywhereAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Removed backend.dictfetchmany(), as it wasn't being used anywhereAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5969 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Removed backend.dictfetchone(), as it wasn't being used anywhereAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored quote_name() to DatabaseOperations.quote_name(). Refs #5106Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_start_transaction_sql() to ↵Adrian Holovaty
DatabaseOperations.start_transaction_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_sql_sequence_reset() to ↵Adrian Holovaty
DatabaseOperations.sequence_reset_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_sql_flush() to DatabaseOperations.sql_flush(). Refs #5106Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_random_function_sql() to ↵Adrian Holovaty
DatabaseOperations.random_function_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5962 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_pk_default_value() to DatabaseOperations.pk_default_value(). ↵Adrian Holovaty
Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5961 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_max_name_length() to DatabaseOperations.max_name_length(). ↵Adrian Holovaty
Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5960 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_limit_offset_sql() to DatabaseOperations.limit_offset_sql(). ↵Adrian Holovaty
Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5959 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_last_insert_id() to DatabaseOperations.last_insert_id(). Refs ↵Adrian Holovaty
#5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5958 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_fulltext_search_sql() to ↵Adrian Holovaty
DatabaseOperations.fulltext_search_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5957 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_drop_foreignkey_sql() to ↵Adrian Holovaty
DatabaseOperations.drop_foreignkey_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_deferrable_sql() to DatabaseOperations.deferrable_sql(). Refs ↵Adrian Holovaty
#5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5955 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_datetime_cast_sql() to ↵Adrian Holovaty
DatabaseOperations.datetime_cast_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5953 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_date_trunc_sql() to DatabaseOperations.date_trunc_sql(). Refs ↵Adrian Holovaty
#5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_date_extract_sql() to DatabaseOperations.date_extract_sql(). ↵Adrian Holovaty
Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Began implementing BaseDatabaseOperations class for every database backend. ↵Adrian Holovaty
This class will be used to hold the database-specific methods that currently live at the module level in each backend. Only autoinc_sql() has been implemented so far. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored all database backends to inherit from a common base class to ↵Adrian Holovaty
remove quite a bit of duplicated code. Thanks for the patch, Brian Harring. Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-11Fixed #5134 -- Return empty strings as Unicode in psycopg1 backend.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5834 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-27Fixed #1465: added support for regex lookups. Thanks, Tom Tobin.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5555 bcc190cf-cafb-0310-a4f2-bffc1f526a37