diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2019-11-04 19:50:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2019-11-04 19:50:17 +0000 |
| commit | 98f7c0c080ebbc8236fc0cc98970cb1b0112c01e (patch) | |
| tree | f119c0003461e0bd7426bb493391a1c563817bb4 /lib/sqlalchemy/dialects/postgresql | |
| parent | bee7c3462d6235b7e108dbdbcd0727cdcbc49eb0 (diff) | |
| parent | 29330ec1596f12462c501a65404ff52005b16b6c (diff) | |
| download | sqlalchemy-98f7c0c080ebbc8236fc0cc98970cb1b0112c01e.tar.gz | |
Merge "Add anonymizing context to cache keys, comparison; convert traversal"
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 17 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/dml.py | 2 |
2 files changed, 7 insertions, 12 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 909d568a7..e94f9913c 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1658,23 +1658,20 @@ class PGCompiler(compiler.SQLCompiler): return "ONLY " + sqltext def get_select_precolumns(self, select, **kw): - if select._distinct is not False: - if select._distinct is True: - return "DISTINCT " - elif isinstance(select._distinct, (list, tuple)): + if select._distinct or select._distinct_on: + if select._distinct_on: return ( "DISTINCT ON (" + ", ".join( - [self.process(col, **kw) for col in select._distinct] + [ + self.process(col, **kw) + for col in select._distinct_on + ] ) + ") " ) else: - return ( - "DISTINCT ON (" - + self.process(select._distinct, **kw) - + ") " - ) + return "DISTINCT " else: return "" diff --git a/lib/sqlalchemy/dialects/postgresql/dml.py b/lib/sqlalchemy/dialects/postgresql/dml.py index 4e77f5a4c..f4467976a 100644 --- a/lib/sqlalchemy/dialects/postgresql/dml.py +++ b/lib/sqlalchemy/dialects/postgresql/dml.py @@ -103,7 +103,6 @@ class Insert(StandardInsert): self._post_values_clause = OnConflictDoUpdate( constraint, index_elements, index_where, set_, where ) - return self @_generative def on_conflict_do_nothing( @@ -138,7 +137,6 @@ class Insert(StandardInsert): self._post_values_clause = OnConflictDoNothing( constraint, index_elements, index_where ) - return self insert = public_factory(Insert, ".dialects.postgresql.insert") |
