summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* - The use of a :class:`.postgresql.ARRAY` object that refersMike Bayer2015-09-191-0/+26
| | | | | | | 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
* - The :class:`.TypeDecorator` type extender will now work in conjunctionMike Bayer2015-08-271-0/+28
| | | | | | | | | | | with a :class:`.SchemaType` implementation, typically :class:`.Enum` or :class:`.Boolean` with regards to ensuring that the per-table events are propagated from the implementation type to the outer type. These events are used to ensure that the constraints or Postgresql types (e.g. ENUM) are correctly created (and possibly dropped) along with the parent table. fixes #2919
* - add a postgresql-specific form of array_agg() that injects theMike Bayer2015-08-271-0/+11
| | | | ARRAY type, references #3132
* - add PG-specific aggregate_order_by(), references #3132Mike Bayer2015-08-271-1/+45
|
* - Added support for "set-aggregate" functions of the formticket_3516Mike Bayer2015-08-262-7/+7
| | | | | | | | | | | ``<function> WITHIN GROUP (ORDER BY <criteria>)``, using the method :class:`.FunctionElement.within_group`. A series of common set-aggregate functions with return types derived from the set have been added. This includes functions like :class:`.percentile_cont`, :class:`.dense_rank` and others. fixes #1370 - make sure we use func.name for all _literal_as_binds in functions.py so we get consistent naming behavior for parameters.
* - Added support for the SQL-standard function :class:`.array_agg`,Mike Bayer2015-08-261-0/+27
| | | | | | | which automatically returns an :class:`.Array` of the correct type and supports index / slice operations. As arrays are only supported on Postgresql at the moment, only actually works on Postgresql. fixes #3132
* - build out a new base type for Array, as well as new any/all operatorsMike Bayer2015-08-251-6/+102
| | | | | | - any/all work for Array as well as subqueries, accepted by MySQL - Postgresql ARRAY now subclasses Array - fixes #3516
* - fix the postgresql_jsonb requirement to include the 9.4 requirementMike Bayer2015-08-181-1/+3
| | | | | | | | - new test for json col['x']['y']['z'] seems to fail pre PG 9.4, fails on comparisons for non-compatible data instead of not matching - no need to call SpecPredicate(db) directly in exclusion functions, by using Predicate.as_predicate() the spec strings can have version comparisons
* - merge of ticket_3514 None-handling branchMike Bayer2015-08-171-0/+55
| | | | | | | | | | | | | | | | - 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-172-27/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-0/+1
| | | | | | | | | 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
* Fix typopr/183Pete Hollobon2015-06-221-1/+1
|
* - for #3455Mike Bayer2015-06-192-28/+41
| | | | | | | | | - 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-192-0/+63
|\
| * Add reflection of PostgreSQL index access methods (USING clause)pr/179Pete Hollobon2015-06-041-0/+19
| |
| * Add reflection of PostgreSQL index storage optionsPete Hollobon2015-06-041-0/+20
| |
| * Add support for PostgreSQL index storage parametersPete Hollobon2015-06-031-0/+24
| | | | | | | | | | Add support for specifying PostgreSQL index storage paramters (e.g. fillfactor).
* | - Repaired the :class:`.ExcludeConstraint` construct to support commonMike Bayer2015-06-161-3/+43
| | | | | | | | | | | | | | 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
* | - Repaired some typing and test issues related to the pypyMike Bayer2015-06-054-38/+37
|/ | | | | | | | | 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/+17
| | | | | | | | :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
* - Fixed a long-standing bug where the :class:`.Enum` type as usedMike Bayer2015-04-041-10/+50
| | | | | | | | | | 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-0/+1
| | | | | | | :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-0/+99
| | | | | | | | | | | | 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
* Merge branch 'postgres-concurrently' of ↵Mike Bayer2015-03-101-0/+10
|\ | | | | | | https://bitbucket.org/iurisilvio/sqlalchemy into pr45
| * Dialect option `postgresql_concurrently` to `Index` construct.Iuri de Silvio2015-02-251-0/+10
| |
* | - add a skip for JSONB on pg8000 if we are on 1.10.1 or earlierMike Bayer2015-03-021-0/+1
| |
* | Merge remote-tracking branch 'origin/pr/132' into pr132Mike Bayer2015-03-021-3/+6
|\ \ | |/ |/|
| * pg8000 client_encoding in create_engine()Tony Locke2014-12-161-3/+6
| | | | | | | | | | The pg8000 dialect now supports the setting of the PostgreSQL parameter client_encoding from create_engine().
* | - Repaired support for Postgresql UUID types in conjunction withMike Bayer2015-02-011-6/+28
| | | | | | | | | | | | | | | | | | | | the ARRAY type when using psycopg2. The psycopg2 dialect now employs use of the psycopg2.extras.register_uuid() hook so that UUID values are always passed to/from the DBAPI as UUID() objects. The :paramref:`.UUID.as_uuid` flag is still honored, except with psycopg2 we need to convert returned UUID objects back into strings when this is disabled. fixes #2940
* | Merge remote-tracking branch 'origin/pr/68' into pr68Mike Bayer2015-02-011-0/+13
|\ \
| * | Add unit test for UUID arrays in PostgreSQL.pr/68Kevin Deldycke2014-02-061-0/+13
| | |
* | | - Added support for the :class:`postgresql.JSONB` datatype whenMike Bayer2015-01-311-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using psycopg2 2.5.4 or greater, which features native conversion of JSONB data so that SQLAlchemy's converters must be disabled; additionally, the newly added psycopg2 extension ``extras.register_default_jsonb`` is used to establish a JSON deserializer passed to the dialect via the ``json_deserializer`` argument. Also repaired the Postgresql integration tests which weren't actually round-tripping the JSONB type as opposed to the JSON type. Pull request courtesy Mateusz Susik. - Repaired the use of the "array_oid" flag when registering the HSTORE type with older psycopg2 versions < 2.4.3, which does not support this flag, as well as use of the native json serializer hook "register_default_json" with user-defined ``json_deserializer`` on psycopg2 versions < 2.5, which does not include native json.
* | | - additional test adjustments for pypy / psycopg2cffi. ThisMike Bayer2015-01-262-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consists mainly of adjusting fixtures to ensure connections are closed explicitly. psycopg2cffi also handles unicode bind parameter names differently than psycopg2, and seems to possibly have a little less control over floating point values at least in one test which is marked as a "fail", though will see if it runs differently on linux than osx.. - changelog for psycopg2cffi, fixes #3052
* | | 78-char widthShaun Stanworth2015-01-262-2/+4
| | |
* | | Added psycopg2cffi dialectShaun Stanworth2015-01-263-4/+6
| | |
* | | - rework assertsql system, fixes #3293Mike Bayer2015-01-182-130/+166
| | |
* | | - Fixed bug where Postgresql dialect would fail to render anMike Bayer2015-01-161-1/+53
| |/ |/| | | | | | | | | | | | | 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
* | - The :meth:`.Operators.match` operator is now handled such that theMike Bayer2014-12-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | return type is not strictly assumed to be boolean; it now returns a :class:`.Boolean` subclass called :class:`.MatchType`. The type will still produce boolean behavior when used in Python expressions, however the dialect can override its behavior at result time. In the case of MySQL, while the MATCH operator is typically used in a boolean context within an expression, if one actually queries for the value of a match expression, a floating point value is returned; this value is not compatible with SQLAlchemy's C-based boolean processor, so MySQL's result-set behavior now follows that of the :class:`.Float` type. A new operator object ``notmatch_op`` is also added to better allow dialects to define the negation of a match operation. fixes #3263
* | - The :meth:`.PGDialect.has_table` method will now query againstMike Bayer2014-12-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | ``pg_catalog.pg_table_is_visible(c.oid)``, rather than testing for an exact schema match, when the schema name is None; this so that the method will also illustrate that temporary tables are present. Note that this is a behavioral change, as Postgresql allows a non-temporary table to silently overwrite an existing temporary table of the same name, so this changes the behavior of ``checkfirst`` in that unusual scenario. fixes #3264
* | - use provide_metadata for new unique constraint / index testsMike Bayer2014-10-041-23/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - add a test for PG reflection of unique index without any unique constraint - for PG, don't include 'duplicates_constraint' in the entry if the index does not actually mirror a constraint - use a distinct method for unique constraint reflection within table - catch unique constraint not implemented condition; this may be within some dialects and also is expected to be supported by Alembic tests - migration + changelogs for #3184 - add individual doc notes as well to MySQL, Postgreql fixes #3184
* | Reflect unique constraints when reflecting a Table objectJohannes Erdfelt2014-09-171-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to reflect a table did not create any UniqueConstraint objects. The reflection core made no calls to get_unique_constraints and as a result, the sqlite dialect would never reflect any unique constraints. MySQL transparently converts unique constraints into unique indexes, but SQLAlchemy would reflect those as an Index object and as a UniqueConstraint. The reflection core will now deduplicate the unique constraints. PostgreSQL would reflect unique constraints as an Index object and as a UniqueConstraint object. The reflection core will now deduplicate the unique indexes.
* | - repair get_foreign_table_names() for PGInsp/dialect levelpr128Mike Bayer2014-09-171-3/+22
| | | | | | | | | | - repair get_view_names() - changelog + migration note
* | - the actual round trip requires password authent set up for the user;Mike Bayer2014-09-171-25/+7
| | | | | | | | we don't actually need a round trip test here as we're only testing reflection.
* | - break out and fix tests for materialized view and foreign tables. foreign ↵Mike Bayer2014-09-161-72/+86
| | | | | | | | tables not working
* | Merge remote-tracking branch 'origin/pr/128' into pr128Mike Bayer2014-09-161-1/+101
|\ \
| * | Added documentation. Changed my mind - added get_foreign_table_names() only ↵pr/128Rodrigo Menezes2014-09-051-0/+6
| | | | | | | | | | | | to PGInspect and not in the Dialect. Added tests for PGInspect and removed a bunch of the old test scaffolding.
| * | Fixing some pep8s and adding get_foreign_tables.Rodrigo Menezes2014-09-031-6/+11
| | |
| * | Merge branch 'master' of https://github.com/zzzeek/sqlalchemy into ↵Rodrigo Menezes2014-08-261-0/+84
| |\ \ | | | | | | | | | | | | feature/postgres-relkind
| * | | Removed all mentions to postgresql_relkindRodrigo Menezes2014-08-261-22/+11
| | | |
| * | | Merge branch 'master' of https://github.com/rclmenezes/sqlalchemyRodrigo Menezes2014-08-141-0/+66
| |\ \ \