<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">using 0.6beta1</p>
<p dir="auto">this used to work in 0.5</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy import create_engine, Table, MetaData,  __version__

print __version__

engine = create_engine('oracle://xxx:xxx@XXX', echo=False)

metadata = MetaData(engine)

engine.execute(&quot;&quot;&quot;create or replace function ADDONE (a number) return number
deterministic
is
begin
  return a+1;
end;
&quot;&quot;&quot;)
try:
    engine.execute('drop table BOB')
except:
    pass
engine.execute('create table BOB (a number)')
engine.execute('create index fn_idx on BOB (ADDONE(a))')

bob_table = Table(
    'bob',
    metadata,
    autoload=True
)"><pre class="notranslate"><code class="notranslate">from sqlalchemy import create_engine, Table, MetaData,  __version__

print __version__

engine = create_engine('oracle://xxx:xxx@XXX', echo=False)

metadata = MetaData(engine)

engine.execute("""create or replace function ADDONE (a number) return number
deterministic
is
begin
  return a+1;
end;
""")
try:
    engine.execute('drop table BOB')
except:
    pass
engine.execute('create table BOB (a number)')
engine.execute('create index fn_idx on BOB (ADDONE(a))')

bob_table = Table(
    'bob',
    metadata,
    autoload=True
)
</code></pre></div>
<p dir="auto">Gives</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;bob.py&quot;, line 28, in &lt;module&gt;
    autoload=True
  File &quot;/home/geraint/work/sqlalchemy/lib/sqlalchemy/schema.py&quot;, line 202, in __new__
    table._init(name, metadata, *args, **kw)
  File &quot;/home/geraint/work/sqlalchemy/lib/sqlalchemy/schema.py&quot;, line 250, in _init
    _bind_or_error(metadata).reflecttable(self, include_columns=include_columns)
  File &quot;/home/geraint/work/sqlalchemy/lib/sqlalchemy/engine/base.py&quot;, line 1450, in reflecttable
    self.dialect.reflecttable(conn, table, include_columns)
  File &quot;/home/geraint/work/sqlalchemy/lib/sqlalchemy/engine/default.py&quot;, line 122, in reflecttable
    return insp.reflecttable(table, include_columns)
  File &quot;/home/geraint/work/sqlalchemy/lib/sqlalchemy/engine/reflection.py&quot;, line 362, in reflecttable
    sa_schema.Index(name, *[table.columns[c](table.columns[c) for c in columns],
  File &quot;/home/geraint/work/sqlalchemy/lib/sqlalchemy/util.py&quot;, line 666, in __getitem__
    return self._data[key](key)
KeyError: u'sys_nc00002$'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "bob.py", line 28, in &lt;module&gt;
    autoload=True
  File "/home/geraint/work/sqlalchemy/lib/sqlalchemy/schema.py", line 202, in __new__
    table._init(name, metadata, *args, **kw)
  File "/home/geraint/work/sqlalchemy/lib/sqlalchemy/schema.py", line 250, in _init
    _bind_or_error(metadata).reflecttable(self, include_columns=include_columns)
  File "/home/geraint/work/sqlalchemy/lib/sqlalchemy/engine/base.py", line 1450, in reflecttable
    self.dialect.reflecttable(conn, table, include_columns)
  File "/home/geraint/work/sqlalchemy/lib/sqlalchemy/engine/default.py", line 122, in reflecttable
    return insp.reflecttable(table, include_columns)
  File "/home/geraint/work/sqlalchemy/lib/sqlalchemy/engine/reflection.py", line 362, in reflecttable
    sa_schema.Index(name, *[table.columns[c](table.columns[c) for c in columns],
  File "/home/geraint/work/sqlalchemy/lib/sqlalchemy/util.py", line 666, in __getitem__
    return self._data[key](key)
KeyError: u'sys_nc00002$'
</code></pre></div>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">all is in the title ... :)<br>
<a href="http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3#LATERAL_JOIN" rel="nofollow">http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3#LATERAL_JOIN</a></p>