summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Add "eager_parenthesis" late-compilation rule, use w/ PG JSON/HSTOREMike Bayer2016-10-011-0/+2
| | | | | | | | | | | | Added compiler-level flags used by Postgresql to place additional parenthesis than would normally be generated by precedence rules around operations involving JSON, HSTORE indexing operators as well as within their operands since it has been observed that Postgresql's precedence rules for at least the HSTORE indexing operator is not consistent between 9.4 and 9.5. Fixes: #3806 Change-Id: I5899677b330595264543b055abd54f3c76bfabf2
* Enable include_table for ON CONFLICT whereclausesMike Bayer2016-09-281-2/+1
| | | | | | | | | Fixed issue in new PG "on conflict" construct where columns including those of the "excluded" namespace would not be table-qualified in the WHERE clauses in the statement. Change-Id: Idfefc93e7e7b0d84805e23d5436d822d606f6a0a Fixes: #3807
* Fix table reference in PostgreSQL documentationpr/303Michael Williamson2016-08-281-1/+1
|
* 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-141-9/+263
| | | | | | | 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
* - Add support for PostgreSQL with PyGreSQLChristoph Zwerschke2016-04-151-1/+3
| | | | | 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-291-1/+1
|
* 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
* - Added :class:`.mysql.JSON` for MySQL 5.7. The JSON type providesMike Bayer2016-01-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* - 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
* - 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
* - add a postgresql-specific form of array_agg() that injects theMike Bayer2015-08-271-0/+5
| | | | ARRAY type, references #3132
* - add PG-specific aggregate_order_by(), references #3132Mike Bayer2015-08-271-0/+6
|
* - build out a new base type for Array, as well as new any/all operatorsMike Bayer2015-08-251-14/+0
| | | | | | - any/all work for Array as well as subqueries, accepted by MySQL - Postgresql ARRAY now subclasses Array - fixes #3516
* - document workaround type for ARRAY of ENUM, fixes #3467Mike Bayer2015-08-181-0/+41
|
* - merge of ticket_3499 indexed access branchMike Bayer2015-08-171-415/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
|
* - 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-161-4/+6
|/ | | | | | | 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
* - 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 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-101-1/+1
|
* - changelog and docs for pullreq bitbucket:45Mike Bayer2015-03-101-0/+18
|
* Dialect option `postgresql_concurrently` to `Index` construct.Iuri de Silvio2015-02-251-2/+9
|
* - Added new user-space accessors for viewing transaction isolationMike Bayer2015-01-201-1/+1
| | | | | | | | | levels; :meth:`.Connection.get_isolation_level`, :attr:`.Connection.default_isolation_level`. - enhance documentation inter-linkage between new accessors, existing isolation_level parameters, as well as in the dialect-level methods which should be fully covered by Engine/Connection level APIs now.
* - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-161-34/+34
| | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* - Fixed bug where Postgresql dialect would fail to render anMike Bayer2015-01-161-2/+7
| | | | | | | | expression in an :class:`.Index` that did not correspond directly to a table-bound column; typically when a :func:`.text` construct was one of the expressions within the index; or could misinterpret the list of expressions if one or more of them were such an expression. fixes #3174