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-Tag: rel_1_1_0b1~98^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e310a8e423d9a4eeb511b7b84dbeccc90c234a1f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - use same colname as the alias we give to the PG function here, fixes #3652 --- diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 756ad7e7e9..9dfcadf19d 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -195,7 +195,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') ) @@ -203,7 +203,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