summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* - Add support for PostgreSQL with PyGreSQLChristoph Zwerschke2016-04-153-2/+248
| | | | | Change-Id: I040b75ff3b4110e7e8b26442a4eb226ba8c26715 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/234
* - Added :meth:`.Select.lateral` and related constructs to allowMike Bayer2016-03-291-0/+1
| | | | | for the SQL standard LATERAL keyword, currently only supported by Postgresql. fixes #2857
* - changelog and docs for #3332, fixes #3332Mike Bayer2016-03-151-6/+4
| | | | | | - make docs for isolation level more consistent between postgresql and mysql - move mysql autocommit tests
* - happy new yearMike Bayer2016-01-2912-12/+12
|
* Fix ArrayOfEnum's handling of empty arrays.pr/229Chase2016-01-191-1/+1
| | | Prior to this change a value of `'{}'` would split into the list `['']`.
* - reorganize schema_translate_map to be succinct and gain the performanceMike Bayer2016-01-111-2/+2
| | | | back by using an attrgetter for the default case
* - Multi-tenancy schema translation for :class:`.Table` objects is added.Mike Bayer2016-01-081-5/+13
| | | | | | | | | This supports the use case of an application that uses the same set of :class:`.Table` objects in many schemas, such as schema-per-user. A new execution option :paramref:`.Connection.execution_options.schema_translate_map` is added. fixes #2685 - latest tox doesn't like the {posargs} in the profile rerunner
* - pg8000 fixes for jsonMike Bayer2016-01-071-0/+1
|
* - Added :class:`.mysql.JSON` for MySQL 5.7. The JSON type providesMike Bayer2016-01-066-185/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | persistence of JSON values in MySQL as well as basic operator support of "getitem" and "getpath", making use of the ``JSON_EXTRACT`` function in order to refer to individual paths in a JSON structure. fixes #3547 - Added a new type to core :class:`.types.JSON`. This is the base of the PostgreSQL :class:`.postgresql.JSON` type as well as that of the new :class:`.mysql.JSON` type, so that a PG/MySQL-agnostic JSON column may be used. The type features basic index and path searching support. fixes #3619 - reorganization of migration docs etc. to try to refer both to the fixes to JSON that helps Postgresql while at the same time indicating these are new features of the new base JSON type. - a rework of the Array/Indexable system some more, moving things that are specific to Array out of Indexable. - new operators for JSON indexing added to core so that these can be compiled by the PG and MySQL dialects individually - rename sqltypes.Array to sqltypes.ARRAY - as there is no generic Array implementation, this is an uppercase type for now, consistent with the new sqltypes.JSON type that is also not a generic implementation. There may need to be some convention change to handle the case of datatypes that aren't generic, rely upon DB-native implementations, but aren't necessarily all named the same thing.
* Merge remote-tracking branch 'origin/pr/216'Mike Bayer2015-11-301-1/+1
|\
| * - Postgres: Do not prefix table with schema in: "FOR UPDATE of <table>"pr/216Diana Clarke2015-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | For example, this query: SELECT s1.users.name FROM s1.users FOR UPDATE OF s1.users should actually be: SELECT s1.users.name FROM s1.users FOR UPDATE OF users fixes #3573
* | fix postgresql exclude contraint to check when= against None rather than ↵pr/215aisch2015-11-231-1/+1
|/ | | | __bool__ eval
* - Fixed the ``.python_type`` attribute of :class:`.postgresql.INTERVAL`Mike Bayer2015-11-191-0/+6
| | | | | | | | | to return ``datetime.timedelta`` in the same way as that of :obj:`.types.Interval.python_type`, rather than raising ``NotImplementedError``. fixes #3571 (cherry picked from commit 29d6f6e19b014bb5ce79032bd8803e32b4da0e5e)
* - Added support for reflecting the source of materialized viewsMike Bayer2015-11-181-5/+21
| | | | | | to the Postgresql version of the :meth:`.Inspector.get_view_definition` method. fixes #3587
* Updated PostgreSQL links to point to "current" rather than hardcoded versionJeff Widman2015-11-051-2/+2
|
* Update links in SQLAlchemy docs that point to postgres docs to use 'devel' ↵Jeff Widman2015-11-041-2/+2
| | | | rather than hardcoded version
* - Added a new type-level modifier :meth:`.TypeEngine.evaluates_none`Mike Bayer2015-09-191-1/+1
| | | | | | | | | | | | | which indicates to the ORM that a positive set of None should be persisted as the value NULL, instead of omitting the column from the INSERT statement. This feature is used both as part of the implementation for :ticket:`3514` as well as a standalone feature available on any type. fixes #3250 - add new documentation section illustrating the "how to force null" use case of #3250 - alter our change from #3514 so that the class-level flag is now called "should_evaluate_none"; so that "evaluates_none" is now a generative method.
* - The use of a :class:`.postgresql.ARRAY` object that refersMike Bayer2015-09-191-1/+14
| | | | | | | to a :class:`.types.Enum` or :class:`.postgresql.ENUM` subtype will now emit the expected "CREATE TYPE" and "DROP TYPE" DDL when the type is used within a "CREATE TABLE" or "DROP TABLE". fixes #2729
* - add a postgresql-specific form of array_agg() that injects theMike Bayer2015-08-274-4/+24
| | | | ARRAY type, references #3132
* - consolidate "constraints.py" into the more general "ext.py",Mike Bayer2015-08-273-100/+92
| | | | for all assorted PG SQL extensions
* - add PG-specific aggregate_order_by(), references #3132Mike Bayer2015-08-273-1/+71
|
* - build out a new base type for Array, as well as new any/all operatorsMike Bayer2015-08-253-192/+48
| | | | | | - any/all work for Array as well as subqueries, accepted by MySQL - Postgresql ARRAY now subclasses Array - fixes #3516
* - forgot to implement py3k logic for JSON.NULLMike Bayer2015-08-181-23/+21
|
* - document workaround type for ARRAY of ENUM, fixes #3467Mike Bayer2015-08-182-0/+45
|
* - merge of ticket_3514 None-handling branchMike Bayer2015-08-171-1/+58
| | | | | | | | | | | | | | | | - Fixes to the ORM and to the postgresql JSON type regarding the ``None`` constant in conjunction with the Postgresql :class:`.JSON` type. When the :paramref:`.JSON.none_as_null` flag is left at its default value of ``False``, the ORM will now correctly insert the Json "'null'" string into the column whenever the value on the ORM object is set to the value ``None`` or when the value ``None`` is used with :meth:`.Session.bulk_insert_mappings`, **including** if the column has a default or server default on it. This makes use of a new type-level flag "evaluates_none" which is implemented by the JSON type based on the none_as_null flag. fixes #3514 - Added a new constant :attr:`.postgresql.JSON.NULL`, indicating that the JSON NULL value should be used for a value regardless of other settings. part of fixes #3514
* - merge of ticket_3499 indexed access branchMike Bayer2015-08-176-707/+756
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The "hashable" flag on special datatypes such as :class:`.postgresql.ARRAY`, :class:`.postgresql.JSON` and :class:`.postgresql.HSTORE` is now set to False, which allows these types to be fetchable in ORM queries that include entities within the row. fixes #3499 - The Postgresql :class:`.postgresql.ARRAY` type now supports multidimensional indexed access, e.g. expressions such as ``somecol[5][6]`` without any need for explicit casts or type coercions, provided that the :paramref:`.postgresql.ARRAY.dimensions` parameter is set to the desired number of dimensions. fixes #3487 - The return type for the :class:`.postgresql.JSON` and :class:`.postgresql.JSONB` when using indexed access has been fixed to work like Postgresql itself, and returns an expression that itself is of type :class:`.postgresql.JSON` or :class:`.postgresql.JSONB`. Previously, the accessor would return :class:`.NullType` which disallowed subsequent JSON-like operators to be used. part of fixes #3503 - The :class:`.postgresql.JSON`, :class:`.postgresql.JSONB` and :class:`.postgresql.HSTORE` datatypes now allow full control over the return type from an indexed textual access operation, either ``column[someindex].astext`` for a JSON type or ``column[someindex]`` for an HSTORE type, via the :paramref:`.postgresql.JSON.astext_type` and :paramref:`.postgresql.HSTORE.text_type` parameters. also part of fixes #3503 - The :attr:`.postgresql.JSON.Comparator.astext` modifier no longer calls upon :meth:`.ColumnElement.cast` implicitly, as PG's JSON/JSONB types allow cross-casting between each other as well. Code that makes use of :meth:`.ColumnElement.cast` on JSON indexed access, e.g. ``col[someindex].cast(Integer)``, will need to be changed to call :attr:`.postgresql.JSON.Comparator.astext` explicitly. This is part of the refactor in references #3503 for consistency in operator use.
* - An adjustment to the new Postgresql feature of reflecting storageMike Bayer2015-07-241-1/+3
| | | | | | | | | options and USING of :ticket:`3455` released in 1.0.6, to disable the feature for Postgresql versions < 8.2 where the ``reloptions`` column is not provided; this allows Amazon Redshift to again work as it is based on an 8.0.x version of Postgresql. Fix courtesy Pete Hollobon. references #3455
* - add a note, references #3487Mike Bayer2015-07-151-0/+10
|
* - Re-fixed this issue first released in 1.0.5 to fix psycopg2cffiMike Bayer2015-06-221-1/+1
| | | | | | | | JSONB support once again, as they suddenly switched on unconditional decoding of JSONB types in version 2.7.1. Version detection now specifies 2.7.1 as where we should expect the DBAPI to do json encoding for us. fixes #3439
* - for #3455Mike Bayer2015-06-191-4/+17
| | | | | | | | | - changelog - versionadded + reflink for new pg storage parameters doc - pep8ing - add additional tests to definitely check that the Index object is created all the way with the opts we want fixes #3455
* Merge remote-tracking branch 'origin/pr/179' into pr179Mike Bayer2015-06-191-3/+36
|\
| * Add reflection of PostgreSQL index access methods (USING clause)pr/179Pete Hollobon2015-06-041-3/+13
| |
| * Add reflection of PostgreSQL index storage optionsPete Hollobon2015-06-041-3/+9
| |
| * Add support for PostgreSQL index storage parametersPete Hollobon2015-06-031-0/+17
| | | | | | | | | | Add support for specifying PostgreSQL index storage paramters (e.g. fillfactor).
* | - Repaired the :class:`.ExcludeConstraint` construct to support commonMike Bayer2015-06-162-11/+36
| | | | | | | | | | | | | | features that other objects like :class:`.Index` now do, that the column expression may be specified as an arbitrary SQL expression such as :obj:`.cast` or :obj:`.text`. fixes #3454
* | - add test cases for pullreq github:182, where we add a newMike Bayer2015-06-141-2/+11
| | | | | | | | | | | | | | | | "max_row_buffer" execution option for BufferedRowResultProxy - also add documentation, changelog and version notes - rework the max_row_buffer argument to be interpreted from the execution options upfront when the BufferedRowResultProxy is first initialized.
* | - Repaired some typing and test issues related to the pypyMike Bayer2015-06-052-5/+30
|/ | | | | | | | | psycopg2cffi dialect, in particular that the current 2.7.0 version does not have native support for the JSONB type. The version detection for psycopg2 features has been tuned into a specific sub-version for psycopg2cffi. Additionally, test coverage has been enabled for the full series of psycopg2 features under psycopg2cffi. fixes #3439
* - Fixed bug where known boolean values used byMike Bayer2015-05-261-0/+4
| | | | | | | | :func:`.engine_from_config` were not being parsed correctly; these included ``pool_threadlocal`` and the psycopg2 argument ``use_native_unicode``. fixes #3435 - add legacy_schema_aliasing config parsing for mssql - move use_native_unicode config arg to the psycopg2 dialect
* - Added support for the case of the misbehaving DBAPI that hasMike Bayer2015-05-151-0/+17
| | | | | | | | | | | pep-249 exception names linked to exception classes of an entirely different name, preventing SQLAlchemy's own exception wrapping from wrapping the error appropriately. The SQLAlchemy dialect in use needs to implement a new accessor :attr:`.DefaultDialect.dbapi_exception_translation_map` to support this feature; this is implemented now for the py-postgresql dialect. fixes #3421
* - Fixed support for "literal_binds" mode when using limit/offsetMike Bayer2015-04-231-2/+3
| | | | | | with Firebird, so that the values are again rendered inline when this is selected. Related to :ticket:`3034`. fixes #3381
* - Fixed a long-standing bug where the :class:`.Enum` type as usedMike Bayer2015-04-041-1/+1
| | | | | | | | | | with the psycopg2 dialect in conjunction with non-ascii values and ``native_enum=False`` would fail to decode return results properly. This stemmed from when the PG :class:`.postgresql.ENUM` type used to be a standalone type without a "non native" option. fixes #3354 - corrected the assertsql comparison rule to expect a non-ascii SQL string
* - Fixed bug where updated PG index reflection as a result ofMike Bayer2015-04-011-31/+53
| | | | | | | :ticket:`3184` would cause index operations to fail on Postgresql versions 8.4 and earlier. The enhancements are now disabled when using an older version of Postgresql. fixes #3343
* - The Postgresql :class:`.postgresql.ENUM` type will emit aMike Bayer2015-03-111-16/+96
| | | | | | | | | | | | DROP TYPE instruction when a plain ``table.drop()`` is called, assuming the object is not associated directly with a :class:`.MetaData` object. In order to accomodate the use case of an enumerated type shared between multiple tables, the type should be associated directly with the :class:`.MetaData` object; in this case the type will only be created at the metadata level, or if created directly. The rules for create/drop of Postgresql enumerated types have been highly reworked in general. fixes #3319
* - copyright 2015Mike Bayer2015-03-1010-10/+10
|
* - changelog and docs for pullreq bitbucket:45Mike Bayer2015-03-101-0/+18
|
* Merge branch 'postgres-concurrently' of ↵Mike Bayer2015-03-101-2/+9
|\ | | | | | | https://bitbucket.org/iurisilvio/sqlalchemy into pr45
| * Dialect option `postgresql_concurrently` to `Index` construct.Iuri de Silvio2015-02-251-2/+9
| |
* | Merge remote-tracking branch 'origin/pr/132' into pr132Mike Bayer2015-03-021-14/+77
|\ \ | |/ |/|
| * Changed pg8000 dialect to cope with native JSONpr/132Tony Locke2015-01-031-1/+12
| | | | | | | | | | For versions > 1.10.1 pg8000 returns de-serialized JSON objects rather than a string. SQL parameters are still strings though.
| * Make pg8000 version detection more robustTony Locke2014-12-161-6/+11
| | | | | | | | | | | | pg8000 uses Versioneer, which means that development versions have version strings that don't fit into the dotted triple number format. Released versions will always fit the triple format though.