From: Mike Bayer Date: Tue, 16 Feb 2016 15:05:58 +0000 (-0500) Subject: - use same colname as the alias we give to the PG function X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=397890293debac8e5945b2347bf73f819be12a9f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - use same colname as the alias we give to the PG function here, fixes #3652 (cherry picked from commit e310a8e423d9a4eeb511b7b84dbeccc90c234a1f) --- diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 148c5df915..327dafc426 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -139,7 +139,7 @@ class FunctionElement(Executable, ColumnElement, FromClause): from sqlalchemy.sql import column - stmt = select([column('data')]).select_from( + stmt = select([column('data_view')]).select_from( func.unnest(Table.data).alias('data_view') ) @@ -147,7 +147,7 @@ class FunctionElement(Executable, ColumnElement, FromClause): .. sourcecode:: sql - SELECT data + SELECT data_view FROM unnest(sometable.data) AS data_view .. versionadded:: 0.9.8 The :meth:`.FunctionElement.alias` method