Re: [sqlalchemy] almbic postgres text_pattern_ops on index

2018-01-18 Thread Mike Bayer
On Thu, Jan 18, 2018 at 1:35 PM, kris wrote: > > > Try to create a postgres specific option while creating index , pointer > appreciated > > this link > http://alembic.zzzcomputing.com/en/latest/ops.html#alembic.operations.Operations.create_index > suggest I can pass dialect

Re: [sqlalchemy] Suppress SQL statement in DBAPI Error Message?

2018-01-18 Thread Mike Bayer
On Thu, Jan 18, 2018 at 2:05 PM, Rick Suggs wrote: > Is there any way to suppress the SQL statement that is included in the DBAPI > error message? you can use the handle_error event:

Re: [sqlalchemy] session.expire{,_all}_unmodified for dropping objects that are unchanged?!

2018-01-18 Thread Torsten Landschoff
Hello Mike, first, thanks for considering my ramblings and thanks for the reply! On 17.01.2018 23:23, Mike Bayer wrote: > this is overkill. Here's what your code looks like without an ORM: Yes, I think my message was lost in translation or rather in oversimplification. > this is very specific

[sqlalchemy] Suppress SQL statement in DBAPI Error Message?

2018-01-18 Thread Rick Suggs
Is there any way to suppress the SQL statement that is included in the DBAPI error message? For example: sqlalchemy.exc.DataError: (psycopg2.DataError) invalid input syntax for integer: "hello" LINE 1: INSERT INTO test (num, data) VALUES (100, 'hello');

[sqlalchemy] almbic postgres text_pattern_ops on index

2018-01-18 Thread kris
Try to create a postgres specific option while creating index , pointer appreciated this link http://alembic.zzzcomputing.com/en/latest/ops.html#alembic.operations.Operations.create_index suggest I can pass dialect specific options def upgrade():

Re: [sqlalchemy] NVARCHAR vs VARCHAR in mssql

2018-01-18 Thread Mike Bayer
On Thu, Jan 18, 2018 at 12:31 PM, Lukasz Szybalski wrote: > Hello, > I have a query in sqlalchemy like below where I lookup contract# in mssql. > How do I enforce the varchar instead of nvarchar? I tried converting my > field to "str(mycurrent)" but that didn't do anything.

[sqlalchemy] NVARCHAR vs VARCHAR in mssql

2018-01-18 Thread Lukasz Szybalski
Hello, I have a query in sqlalchemy like below where I lookup contract# in mssql. How do I enforce the varchar instead of nvarchar? I tried converting my field to "str(mycurrent)" but that didn't do anything. Is there some other spot to force VARCHAR to be sent? You can find that the query that

Re: [sqlalchemy] Re: Temporarily disable DB persistence for optimization routine

2018-01-18 Thread Ruben Di Battista
I confirm what I said. The run in multiprocessing was regenerating instances because after deserialization they were getting new IDs. I tried to implement a custom __hash__ but it seems that SQLAlchemy does not get it. What I did was disabling the backref cascade for `Satellite` and

Re: [sqlalchemy] Re: exception message encoded in utf8

2018-01-18 Thread Nico C.
I think I can help reproduce this, but one has to configure the base system in a non C or english locale. E.g. the system I work with is in french: it's default locale is fr_FR.UTF-8, hence the postgresql server I installed on it runs with that locale too, by default. One can check with the