On Mar 11, 12:08 am, Gerry Reno <gr...@verizon.net> wrote:
> Been doing great with SQLAlchemy 0.6beta1 for the past week after a
> couple snags migrating from 5.5.
>
> Today I hit a small problem with postgresql on DropTables:
>
>     running this command:
>     engine.execute(DropTable(table, cascade=True))
>
>     produced this error:
> sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at or
> near "CONSTRAINTS"
> LINE 2: DROP TABLE users CASCADE CONSTRAINTS
>                                  ^
>  '\nDROP TABLE users CASCADE CONSTRAINTS' {}
>
> The problem seems to be with the keyword 'CONSTRAINTS' for the
> postgresql dialect.  The drop succeeds without it.
>
> test=# DROP TABLE users CASCADE CONSTRAINTS;
> ERROR:  syntax error at or near "CONSTRAINTS"
> LINE 1: DROP TABLE users CASCADE CONSTRAINTS;
>                                  ^
> test=# DROP TABLE users CASCADE;
> NOTICE:  drop cascades to constraint addresses_user_id_fkey on table
> addresses
> DROP TABLE
>
> -Gerry

Also tried against MySQL and got the same error for the same reason as
well:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1064, "You have
an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'CONSTRAINTS' at
line 1") '\nDROP TABLE users CASCADE CONSTRAINTS' ()

-Gerry

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to