]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
PGDialect.get_check_constraints: Handle "NOT VALID"
authorBill Finn <bill@angaza.com>
Tue, 27 Aug 2019 16:21:57 +0000 (12:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 27 Aug 2019 16:56:11 +0000 (12:56 -0400)
commit15ef152112a8f0b96d74f438a7d334065517fec0
treebccfb3393068aecc218a9cd28493c2aeb25b2677
parentef7e9bba22534e294fbb0cbf3e6a76ae8079d46e
PGDialect.get_check_constraints: Handle "NOT VALID"

Added support for reflection of CHECK constraints that include the special
PostgreSQL qualifier "NOT VALID", which can be present for CHECK
constraints that were added to an exsiting table with the directive that
they not be applied to existing data in the table. The PostgreSQL
dictionary for CHECK constraints as returned by
:meth:`.Inspector.get_check_constraints` may include an additional entry
``dialect_options`` which within will contain an entry ``"not_valid":
True`` if this symbol is detected.   Pull request courtesy Bill Finn.

Fixes: #4824
Closes: #4825
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4825
Pull-request-sha: a0e1ab133c2d46521a74e55423ac2ba866682dae

Change-Id: I78365f50055c95474c92124b85df66c5c80c00c8
(cherry picked from commit 3980a9a455d08c5073cabc3c2b77de46fa36d7b4)
doc/build/changelog/unreleased_13/4824.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/engine/reflection.py
test/dialect/postgresql/test_reflection.py