]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix #10693: postgresql dialect should reflect DOMAIN types 10729/head
authorThomas Stephenson <t.stephenson@cqu.edu.au>
Tue, 28 Nov 2023 07:52:55 +0000 (18:52 +1100)
committerThomas Stephenson <t.stephenson@cqu.edu.au>
Wed, 21 Feb 2024 05:07:06 +0000 (16:07 +1100)
commitadac164d191138265ecd64a28be91254a53a9c25
tree5bb55d0dd40d358899832f6ca97e3698d6aeac68
parent1c58fe53b6fd069cbb82955ddaf9eb5405076146
Fix #10693: postgresql dialect should reflect DOMAIN types

Also, refactor postgresql dialect type reflection into new protected
dialect instance method `PGDialect._reflect_type`

        PGDialect._reflect_type(format_type, enums, domains, type_description)

test #10693:

- psycopg and pg8000 raise different dbapi exceptions when a domain
  constraint fails. Weaken test assertion to catch both

review #10693:
- type_description is required parameter to _reflect_type
- fix docstring typo
- make arrayspec regex a class variable
- Use equality checks on attype_args
- reflected array dimensionality is always 1
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/named_types.py
test/dialect/postgresql/test_reflection.py
test/dialect/postgresql/test_types.py