there's no "USING btree" generated by the CreateIndex construct unless you specify "postgresql_using" which I do not see in your code.
here's a test using both desc() and "using" which works as advertised:
from sqlalchemy import *
t = Table('t', MetaData(), Column('column', String(50)))
ix = Index('ix_table_column_desc', t.c.column.desc(), postgresql_using='btree')
e = create_engine("postgresql://scott:tiger@localhost/test", echo=True)
c = e.connect()
tr = c.begin()
t.create(c)
output:
2013-10-07 14:05:28,064 INFO sqlalchemy.engine.base.Engine select version()
2013-10-07 14:05:28,064 INFO sqlalchemy.engine.base.Engine {}
2013-10-07 14:05:28,065 INFO sqlalchemy.engine.base.Engine select
current_schema()
2013-10-07 14:05:28,065 INFO sqlalchemy.engine.base.Engine {}
2013-10-07 14:05:28,067 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2013-10-07 14:05:28,067 INFO sqlalchemy.engine.base.Engine
CREATE TABLE t (
"column" VARCHAR(50)
)
2013-10-07 14:05:28,067 INFO sqlalchemy.engine.base.Engine {}
2013-10-07 14:05:28,069 INFO sqlalchemy.engine.base.Engine CREATE INDEX
ix_table_column_desc ON t USING btree ("column" DESC)
2013-10-07 14:05:28,069 INFO sqlalchemy.engine.base.Engine {}
On Oct 7, 2013, at 1:37 PM, Pedro Romano <[email protected]> wrote:
> According to the documentation, the following index definition:
>
> Index('ix_table_column_desc', table.c.column.desc())
>
> should render in PostgreSQL to:
>
> CREATE INDEX ix_table_column_desc
> ON table
> USING btree
> (modified DESC);
>
> but instead the DESC is omitted and I only get:
>
> CREATE INDEX ix_table_column_desc
> ON table
> USING btree
> (modified);
>
> Am I missing some detail here? Should I create a ticket about this issue?
>
> Thanks,
> --Pedro.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
signature.asc
Description: Message signed with OpenPGP using GPGMail
