Loading django/db/backends/postgresql_psycopg2/operations.py +4 −15 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ class DatabaseOperations(BaseDatabaseOperations): super(DatabaseOperations, self).__init__(connection) def date_extract_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. return "EXTRACT('dow' FROM %s) + 1" % field_name Loading @@ -34,7 +34,7 @@ class DatabaseOperations(BaseDatabaseOperations): return '(%s)' % conn.join([sql, 'interval \'%s\'' % mods]) def date_trunc_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) def datetime_extract_sql(self, lookup_type, field_name, tzname): Loading @@ -43,7 +43,7 @@ class DatabaseOperations(BaseDatabaseOperations): params = [tzname] else: params = [] # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. sql = "EXTRACT('dow' FROM %s) + 1" % field_name Loading @@ -57,7 +57,7 @@ class DatabaseOperations(BaseDatabaseOperations): params = [tzname] else: params = [] # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) return sql, params Loading Loading @@ -178,17 +178,6 @@ class DatabaseOperations(BaseDatabaseOperations): def prep_for_iexact_query(self, x): return x def check_aggregate_support(self, aggregate): """Check that the backend fully supports the provided aggregate. The implementation of population statistics (STDDEV_POP and VAR_POP) under Postgres 8.2 - 8.2.4 is known to be faulty. Raise NotImplementedError if this is the database in use. """ if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'): if 80200 <= self.connection.pg_version <= 80204: raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function) def max_name_length(self): """ Returns the maximum length of an identifier. Loading docs/howto/custom-model-fields.txt +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ only the common types, such as ``VARCHAR`` and ``INTEGER``. For more obscure column types, such as geographic polygons or even user-created types such as `PostgreSQL custom types`_, you can define your own Django ``Field`` subclasses. .. _PostgreSQL custom types: http://www.postgresql.org/docs/8.2/interactive/sql-createtype.html .. _PostgreSQL custom types: http://www.postgresql.org/docs/current/interactive/sql-createtype.html Alternatively, you may have a complex Python object that can somehow be serialized to fit into a standard database column type. This is another case Loading docs/ref/contrib/gis/install/create_template_postgis-debian.sh +0 −7 Original line number Diff line number Diff line Loading @@ -3,13 +3,6 @@ GEOGRAPHY=0 POSTGIS_SQL=postgis.sql # For Ubuntu 8.x and 9.x releases. if [ -d "/usr/share/postgresql-8.3-postgis" ] then POSTGIS_SQL_PATH=/usr/share/postgresql-8.3-postgis POSTGIS_SQL=lwpostgis.sql fi # For Ubuntu 10.04 if [ -d "/usr/share/postgresql/8.4/contrib" ] then Loading docs/ref/contrib/gis/install/index.txt +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ supported versions, and any notes for each of the supported database backends: ================== ============================== ================== ========================================= Database Library Requirements Supported Versions Notes ================== ============================== ================== ========================================= PostgreSQL GEOS, PROJ.4, PostGIS 8.2+ Requires PostGIS. PostgreSQL GEOS, PROJ.4, PostGIS 8.4+ Requires PostGIS. MySQL GEOS 5.x Not OGC-compliant; :ref:`limited functionality <mysql-spatial-limitations>`. Oracle GEOS 10.2, 11 XE not supported; not tested with 9. SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.6.+ Requires SpatiaLite 2.3+, pysqlite2 2.5+ Loading docs/ref/databases.txt +3 −16 Original line number Diff line number Diff line Loading @@ -77,20 +77,7 @@ negating the effect of persistent connections. PostgreSQL notes ================ Django supports PostgreSQL 8.2 and higher. PostgreSQL 8.2 to 8.2.4 ----------------------- The implementation of the population statistics aggregates ``STDDEV_POP`` and ``VAR_POP`` that shipped with PostgreSQL 8.2 to 8.2.4 are `known to be faulty`_. Users of these releases of PostgreSQL are advised to upgrade to `Release 8.2.5`_ or later. Django will raise a ``NotImplementedError`` if you attempt to use the ``StdDev(sample=False)`` or ``Variance(sample=False)`` aggregate with a database backend that falls within the affected release range. .. _known to be faulty: http://archives.postgresql.org/pgsql-bugs/2007-07/msg00046.php .. _Release 8.2.5: http://www.postgresql.org/docs/devel/static/release-8-2-5.html Django supports PostgreSQL 8.4 and higher. PostgreSQL connection settings ------------------------------- Loading Loading @@ -165,7 +152,7 @@ such as ``REPEATABLE READ`` or ``SERIALIZABLE``, set it in the handle exceptions raised on serialization failures. This option is designed for advanced uses. .. _postgresql-isolation-levels: http://www.postgresql.org/docs/devel/static/transaction-iso.html .. _postgresql-isolation-levels: http://www.postgresql.org/docs/current/static/transaction-iso.html Indexes for ``varchar`` and ``text`` columns -------------------------------------------- Loading @@ -179,7 +166,7 @@ for the column. The extra index is necessary to correctly perform lookups that use the ``LIKE`` operator in their SQL, as is done with the ``contains`` and ``startswith`` lookup types. .. _PostgreSQL operator class: http://www.postgresql.org/docs/8.4/static/indexes-opclass.html .. _PostgreSQL operator class: http://www.postgresql.org/docs/current/static/indexes-opclass.html .. _mysql-notes: Loading Loading
django/db/backends/postgresql_psycopg2/operations.py +4 −15 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ class DatabaseOperations(BaseDatabaseOperations): super(DatabaseOperations, self).__init__(connection) def date_extract_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. return "EXTRACT('dow' FROM %s) + 1" % field_name Loading @@ -34,7 +34,7 @@ class DatabaseOperations(BaseDatabaseOperations): return '(%s)' % conn.join([sql, 'interval \'%s\'' % mods]) def date_trunc_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) def datetime_extract_sql(self, lookup_type, field_name, tzname): Loading @@ -43,7 +43,7 @@ class DatabaseOperations(BaseDatabaseOperations): params = [tzname] else: params = [] # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. sql = "EXTRACT('dow' FROM %s) + 1" % field_name Loading @@ -57,7 +57,7 @@ class DatabaseOperations(BaseDatabaseOperations): params = [tzname] else: params = [] # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) return sql, params Loading Loading @@ -178,17 +178,6 @@ class DatabaseOperations(BaseDatabaseOperations): def prep_for_iexact_query(self, x): return x def check_aggregate_support(self, aggregate): """Check that the backend fully supports the provided aggregate. The implementation of population statistics (STDDEV_POP and VAR_POP) under Postgres 8.2 - 8.2.4 is known to be faulty. Raise NotImplementedError if this is the database in use. """ if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'): if 80200 <= self.connection.pg_version <= 80204: raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function) def max_name_length(self): """ Returns the maximum length of an identifier. Loading
docs/howto/custom-model-fields.txt +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ only the common types, such as ``VARCHAR`` and ``INTEGER``. For more obscure column types, such as geographic polygons or even user-created types such as `PostgreSQL custom types`_, you can define your own Django ``Field`` subclasses. .. _PostgreSQL custom types: http://www.postgresql.org/docs/8.2/interactive/sql-createtype.html .. _PostgreSQL custom types: http://www.postgresql.org/docs/current/interactive/sql-createtype.html Alternatively, you may have a complex Python object that can somehow be serialized to fit into a standard database column type. This is another case Loading
docs/ref/contrib/gis/install/create_template_postgis-debian.sh +0 −7 Original line number Diff line number Diff line Loading @@ -3,13 +3,6 @@ GEOGRAPHY=0 POSTGIS_SQL=postgis.sql # For Ubuntu 8.x and 9.x releases. if [ -d "/usr/share/postgresql-8.3-postgis" ] then POSTGIS_SQL_PATH=/usr/share/postgresql-8.3-postgis POSTGIS_SQL=lwpostgis.sql fi # For Ubuntu 10.04 if [ -d "/usr/share/postgresql/8.4/contrib" ] then Loading
docs/ref/contrib/gis/install/index.txt +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ supported versions, and any notes for each of the supported database backends: ================== ============================== ================== ========================================= Database Library Requirements Supported Versions Notes ================== ============================== ================== ========================================= PostgreSQL GEOS, PROJ.4, PostGIS 8.2+ Requires PostGIS. PostgreSQL GEOS, PROJ.4, PostGIS 8.4+ Requires PostGIS. MySQL GEOS 5.x Not OGC-compliant; :ref:`limited functionality <mysql-spatial-limitations>`. Oracle GEOS 10.2, 11 XE not supported; not tested with 9. SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.6.+ Requires SpatiaLite 2.3+, pysqlite2 2.5+ Loading
docs/ref/databases.txt +3 −16 Original line number Diff line number Diff line Loading @@ -77,20 +77,7 @@ negating the effect of persistent connections. PostgreSQL notes ================ Django supports PostgreSQL 8.2 and higher. PostgreSQL 8.2 to 8.2.4 ----------------------- The implementation of the population statistics aggregates ``STDDEV_POP`` and ``VAR_POP`` that shipped with PostgreSQL 8.2 to 8.2.4 are `known to be faulty`_. Users of these releases of PostgreSQL are advised to upgrade to `Release 8.2.5`_ or later. Django will raise a ``NotImplementedError`` if you attempt to use the ``StdDev(sample=False)`` or ``Variance(sample=False)`` aggregate with a database backend that falls within the affected release range. .. _known to be faulty: http://archives.postgresql.org/pgsql-bugs/2007-07/msg00046.php .. _Release 8.2.5: http://www.postgresql.org/docs/devel/static/release-8-2-5.html Django supports PostgreSQL 8.4 and higher. PostgreSQL connection settings ------------------------------- Loading Loading @@ -165,7 +152,7 @@ such as ``REPEATABLE READ`` or ``SERIALIZABLE``, set it in the handle exceptions raised on serialization failures. This option is designed for advanced uses. .. _postgresql-isolation-levels: http://www.postgresql.org/docs/devel/static/transaction-iso.html .. _postgresql-isolation-levels: http://www.postgresql.org/docs/current/static/transaction-iso.html Indexes for ``varchar`` and ``text`` columns -------------------------------------------- Loading @@ -179,7 +166,7 @@ for the column. The extra index is necessary to correctly perform lookups that use the ``LIKE`` operator in their SQL, as is done with the ``contains`` and ``startswith`` lookup types. .. _PostgreSQL operator class: http://www.postgresql.org/docs/8.4/static/indexes-opclass.html .. _PostgreSQL operator class: http://www.postgresql.org/docs/current/static/indexes-opclass.html .. _mysql-notes: Loading