]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- use same colname as the alias we give to the PG function
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Feb 2016 15:05:58 +0000 (10:05 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Feb 2016 15:06:49 +0000 (10:06 -0500)
here, fixes #3652

(cherry picked from commit e310a8e423d9a4eeb511b7b84dbeccc90c234a1f)

lib/sqlalchemy/sql/functions.py

index 148c5df9154be96665a1eb7e695e02c5b7dfb859..327dafc4261af8640d575f510b6aefc578219a99 100644 (file)
@@ -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