diff options
author | Robin Thomas <robin.thomas@livestream.com> | 2016-04-14 12:57:15 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-06-14 15:03:14 -0400 |
commit | 4e9ab7a72f0ad506cf519069fd67127f63e5f2aa (patch) | |
tree | fe46fca73605597bf8274ad6bf7f24878a33c399 /lib/sqlalchemy/sql/compiler.py | |
parent | 31a0da32a8af2503c6b94123a0e869816d83c707 (diff) | |
download | sqlalchemy-4e9ab7a72f0ad506cf519069fd67127f63e5f2aa.tar.gz |
Add ON CONFLICT support for Postgresql
Fixes: #3529
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Ie3bf6ad70d9be9f0e44938830e922db03573991a
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/258
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 6d9ab9039..94c7db20a 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1984,6 +1984,12 @@ class SQLCompiler(Compiled): text += " VALUES (%s)" % \ ', '.join([c[1] for c in crud_params]) + if insert_stmt._post_values_clause is not None: + post_values_clause = self.process( + insert_stmt._post_values_clause, **kw) + if post_values_clause: + text += " " + post_values_clause + if returning_clause and not self.returning_precedes_values: text += " " + returning_clause |