[sqlalchemy] Renaming primary key column in MYSQL

2012-07-23 Thread pravin battula
Hi, I'm getting below error while trying to rename a primary key column. *OperationalError: (OperationalError) (1025, Error on rename of '.\\test\\#sql-540_8' to '.\\test\\users' (errno: 150)) '\nALTER TABLE users CHANGE COLUMN user_id `Users_Id` INTEGER NOT NULL AUTO_INCREMENT' () * Below is

[sqlalchemy] Re: Renaming primary key column in MYSQL

2012-07-23 Thread Ergo
Hi Pravin, The problem you are seeing here is probably related to the fact you have some other foreign keys that rely on the user_id column, Mysql will do everything to make your life miserable if you change the name of the column/size of type that has other constraints depend on it - and the

[sqlalchemy] Re: Renaming primary key column in MYSQL

2012-07-23 Thread pravin battula
Hey Ergo, Thanks for the reply. I wonder what will happen to the performance when trying to drop and recreate the foreign key constraints if the table has thousands of data(lets say 50k)? Regards Pravin B On Monday, 23 July 2012 19:02:23 UTC+5:30, Ergo wrote: Hi Pravin, The problem

[sqlalchemy] Re: Renaming primary key column in MYSQL

2012-07-23 Thread Ergo
Unless we are talking millions of rows and table of size 500+mb, nothing happens - it will be very fast, Normally when you start running alters on your table it will get locked for a while, but unless the table is really big you wont notice anything. The performance of those operations depends

Re: [sqlalchemy] Oracle, version_id_col, and timestamps with time zones

2012-07-23 Thread Tim
I used TypeDecorator and get_dbapi_type to return the type object I wanted. The parameters get the type cx_Oracle.TIMESTAMP for any filtering I do myself, but the ones used in the version feature seem to ignore this and thus still fail to locate the row. On Friday, July 20, 2012 4:12:45 PM

[sqlalchemy] MS SQL: getting values of stored procedure OUT parameters

2012-07-23 Thread Don Dwiggins
I'm writing code that I'd like to be dialect-free as much as possible; I'll be using at least MS SQL and PostgreSQL databases with equivalent schemas. In the MS DBs, there are stored procedures that have OUT parameters. The only way that I've found in some web searching to get the values of

Re: [sqlalchemy] Oracle, version_id_col, and timestamps with time zones

2012-07-23 Thread Michael Bayer
the sqlalchemy.types.TIMESTAMP type has dbapi.TIMESTAMP established as the DBAPI type object to use.When the cx_oracle dialect is in use, the cursor.setinputsizes() method is called, passing in a value for every type that has a dbapi type defined with it, with the exception of a handful of

Re: [sqlalchemy] MS SQL: getting values of stored procedure OUT parameters

2012-07-23 Thread Michael Bayer
what does the DBAPI, pyodbc, have to say here ?When we use OUT parameters with cx_oracle, cx_oracle has explicit support for OUT params, and SQLAlchemy provides a special bind construct which works with it. To my knowledge pyodbc has no such feature. SQL Server should support the