summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixespr/299Ville Skyttä2016-08-082-3/+3
|
* Build string/int processors for JSONIndexType, JSONPathTypeMike Bayer2016-08-041-2/+20
| | | | | | | | | | | | Fixed regression in JSON datatypes where the "literal processor" for a JSON index value, that needs to take effect for example within DDL, would not be invoked for the value. The native String and Integer datatypes are now called upon from within the JSONIndexType and JSONPathType. This is applied to the generic, Postgresql, and MySQL JSON types. Change-Id: Ifa5f2acfeee57a79d01d7fc85d265a37bd27c716 Fixes: #3765
* Repair PG BIGSERIAL w/ TypeDecorator, VariantMike Bayer2016-07-041-0/+3
| | | | | | | | | | | | | Some of the dialect impl memoization for TypeDecorator necessarily keeps the top-level TypeDecorator type around, since a user-defined type will have bind and result set processing behavior. For both TypeDecorator and Variant, PG dialect needs to ensure it's looking at the SQLAlchemy type to check for SmallInteger / BigInteger. Fixes: 3739 Change-Id: I2d45fb997f17c6272d6bb826a77d2dba665adae7 (cherry picked from commit 421fa6b8bf9f0c3c5041579c89ec405ce0f5e0b0)
* Add ON CONFLICT support for PostgresqlRobin Thomas2016-06-143-10/+476
| | | | | | | Fixes: #3529 Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: Ie3bf6ad70d9be9f0e44938830e922db03573991a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/258
* Support `postgresql_concurrently` on index dropping.Iuri de Silvio2016-06-081-5/+36
| | | | | | | | | | | | Also adds version detection so that DROP INDEX CONCURRENTLY only renders if the Postgresql version is 9.2 or higher; for CREATE INDEX CONCURRENTLY, version detection is added to allow the phrase to omit if the Postgresql version is less than 8.2. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I597287e0ebbbe256c957a3579b58ace6848ab4f4 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/84
* Merge "Support normal /materialized views in PG separately"mike bayer2016-06-081-2/+36
|\
| * Support normal /materialized views in PG separatelySebastian Bank2016-06-061-2/+36
| | | | | | | | | | | | Fixes: #3588 Change-Id: Ifbfcab67375f289ddb5c4522f4b803cb8b7c34de Pull-request: https://github.com/zzzeek/sqlalchemy/pull/250
* | Add 'FOR NO KEY UPDATE' / 'FOR KEY SHARE' support for PostgresqlSergey Skopin2016-06-081-1/+6
|/ | | | | | | | Adds ``key_share=True`` for with_for_update(). Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I74e0c3fcbc023e1dc98a1fa0c7db67b4c3693a31 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/279
* Merge "Refine PG inspection methods"mike bayer2016-06-061-94/+34
|\
| * Refine PG inspection methodsSebastian Bank2016-06-061-94/+34
| | | | | | | | | | | | | | | | | | | | This refines get_schema_names(), get_table_names(), get_view_defintion(), _get_foreign_table_names(), and get_view_names() to use better queries and remove unnecessary explicit encoding logic. Pull-request: https://github.com/zzzeek/sqlalchemy/pull/250 Change-Id: I7e87b29c34b97b37f21bbc83392b2274af4db0ab
* | Replace some uses of re.sub with str.lstrip/replaceVille Skyttä2016-06-061-1/+1
|/ | | | | Change-Id: I98cd60b6830ee94e39ba9307523a9e8fb93bf4e8 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/280
* Add SKIP LOCKED support for Postgresql, OracleJack Zhou2016-06-021-0/+2
| | | | | | | | This adds `SELECT ... FOR UPDATE SKIP LOCKED`/ `SELECT ... FOR SHARE SKIP LOCKED` rendering. Change-Id: Id1dc4f1cafc1de23f397a6f73d54ab2c58d5910d Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/86
* Add postgresql_tablespace option on Indexbeenje2016-06-011-1/+19
| | | | | | | | | This complements the same-named parameter available on Table. Fixes: #3720 Change-Id: I56e081e2a551f37c3f392ca4b301c9ef82b94e59 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/233
* Implemented CHECK constraint reflection for SQLite and PostgreSQLAlex Grönholm2016-06-011-0/+25
| | | | | | Co-Authored-By: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: Ie6cf2d2958d1c567324db9e08fef2d3186e97350 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/80
* Handle `SSL error: decryption failed or bad record mac`Iuri de Silvio2016-05-131-0/+1
| | | | | | | | | This is another psycopg2 error message representing an unusable connection. Fixes #3715 Change-Id: Ida6e212963e9c7336bf2944e7ef928619ac3a0e7 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/85
* - 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