diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-18 11:33:19 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-18 11:33:41 -0500 |
commit | bba2269922efebbee83271ad8a53d2d08a85762f (patch) | |
tree | 69d8b439f53a46b9e93d668f0011961fdc3c1c76 | |
parent | aec9bb16e62fa7a7541cb91691378244644d1487 (diff) | |
download | sqlalchemy-bba2269922efebbee83271ad8a53d2d08a85762f.tar.gz |
- further edit the unnest() example to suit PG's esoteric requirements
exactly
(cherry picked from commit c97aa63789036fc145503f03123275253ae02d2c)
-rw-r--r-- | lib/sqlalchemy/sql/functions.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 009ddbdfc..6b7effa36 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -162,14 +162,16 @@ class FunctionElement(Executable, ColumnElement, FromClause): :class:`.FunctionElement`. This construct wraps the function in a named alias which - is suitable for the FROM clause. + is suitable for the FROM clause, in the style accepted for example + by Postgresql. e.g.:: from sqlalchemy.sql import column - stmt = select([column('data_view')]).select_from( - func.unnest(Table.data).alias('data_view') + stmt = select([column('data_view')]).\\ + select_from(SomeTable).\\ + select_from(func.unnest(SomeTable.data).alias('data_view') ) Would produce: @@ -177,7 +179,7 @@ class FunctionElement(Executable, ColumnElement, FromClause): .. sourcecode:: sql SELECT data_view - FROM unnest(sometable.data) AS data_view + FROM sometable, unnest(sometable.data) AS data_view .. versionadded:: 0.9.8 The :meth:`.FunctionElement.alias` method is now supported. Previously, this method's behavior was |