diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-10 14:17:08 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-10 14:17:08 -0500 |
commit | 3f9a343d725eea883aba2145de4cbb7b84f9d08c (patch) | |
tree | f55e890195c76543e689c3b939b84df15cd80a3e /lib/sqlalchemy/dialects/postgresql | |
parent | a6d54d18c1ddac30940affaa940edaad59e5d63f (diff) | |
download | sqlalchemy-3f9a343d725eea883aba2145de4cbb7b84f9d08c.tar.gz |
- Query.distinct() now accepts column expressions
as *args, interpreted by the Postgresql dialect
as DISTINCT ON (<expr>). [ticket:1069]
- select.distinct() now accepts column expressions
as *args, interpreted by the Postgresql dialect
as DISTINCT ON (<expr>). Note this was already
available via passing a list to the `distinct`
keyword argument to select(). [ticket:1069]
- select.prefix_with() accepts multiple expressions
(i.e. *expr), 'prefix' keyword argument to select()
accepts a list or tuple.
- Passing a string to the `distinct` keyword argument
of `select()` for the purpose of emitting special
MySQL keywords (DISTINCTROW etc.) is deprecated -
use `prefix_with()` for this.
- put kw arguments to select() in order
- restore docs for _SelectBase, renamed from _SelectBaseMixin
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 22d269cdf..8bc95ef48 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -457,11 +457,10 @@ class PGCompiler(compiler.SQLCompiler): return "DISTINCT " elif isinstance(select._distinct, (list, tuple)): return "DISTINCT ON (" + ', '.join( - [(isinstance(col, basestring) and col - or self.process(col)) for col in select._distinct] + [self.process(col) for col in select._distinct] )+ ") " else: - return "DISTINCT ON (" + unicode(select._distinct) + ") " + return "DISTINCT ON (" + self.process(select._distinct) + ") " else: return "" |