[sqlalchemy] Re: TypeDecorator of PostgreSQL ENUM won't create type

2014-01-24 Thread Pedro Romano
that is registered as enum type select * from pg_type where typname = 'visibility'; select * from pg_enum where enumlabel in ('public', 'private', 'custom'); it works pretty fine On Friday, January 24, 2014 11:24:02 AM UTC+1, Pedro Romano wrote: Executing the following test code

Re: [sqlalchemy] TypeDecorator of PostgreSQL ENUM won't create type

2014-01-24 Thread Pedro Romano
Thank you Michael! That did the trick. --Pedro. On Friday, 24 January 2014 17:56:25 UTC, Michael Bayer wrote: On Jan 24, 2014, at 5:24 AM, Pedro Romano pmc...@gmail.com javascript: wrote: Which means the PostgreSQL enumerate type isn't being created as it would have been

[sqlalchemy] Descending sorted index on PostgreSQL

2013-10-07 Thread Pedro Romano
According to the documentationhttp://docs.sqlalchemy.org/en/rel_0_8/core/constraints.html?highlight=desc#functional-indexes, 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

Re: [sqlalchemy] Descending sorted index on PostgreSQL

2013-10-07 Thread Pedro Romano
sqlalchemy.engine.base.Engine {} On Oct 7, 2013, at 1:37 PM, Pedro Romano pmc...@gmail.com javascript: wrote: According to the documentationhttp://docs.sqlalchemy.org/en/rel_0_8/core/constraints.html?highlight=desc#functional-indexes, the following index definition: Index

Re: [sqlalchemy] Descending sorted index on PostgreSQL

2013-10-07 Thread Pedro Romano
as that class has been mapped ahead of that call. On Oct 7, 2013, at 5:09 PM, Pedro Romano pmc...@gmail.com javascript: wrote: Thanks for quick and comprehensive reply Michael. I apologise for having been lazy and not providing an example that illustrated the issue. The examples of rendered SQL

[sqlalchemy] 'ThreadLocalMetaData' support for 'schema'

2013-04-07 Thread Pedro Romano
Having to support different PostgreSQL schemas per web request and finding my current approach of setting the PostgreSQL schema search path a bit convoluted, when I try to use longer lived sessions in unit tests for convenience, because the session starts using a new database connection after

Re: [sqlalchemy] 'ThreadLocalMetaData' support for 'schema'

2013-04-07 Thread Pedro Romano
, is to set it in the after_begin Session event: from sqlalchemy import event @event.listens_for(Session, after_begin) def after_begin(session, trans, conn): conn.execute(set search path to my_schema, public) On Apr 7, 2013, at 6:09 AM, Pedro Romano pmc...@gmail.com javascript: wrote

[sqlalchemy] Re: SQLAlchemy 0.8.0b1 released

2012-10-31 Thread Pedro Romano
A big thank you to Mike and all the other contributors, for what is a shining example of usefulness, quality and excellence! -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit

[sqlalchemy] Should 'SAVEPOINT' transaction (i.e.'begin_nested') support be considered usable with SQLite?

2012-10-26 Thread Pedro Romano
I have tried using 'SAVEPOINT' transactions (via 'session.begin_nested') with a 'SQLite' database connection, but got an exception when a 'session.add()', triggered an integrity error, nstead of the expected 'ROLLBACK TO SAVEPOINT': The logged statements are: BEGIN (implicit) SAVEPOINT

Re: [sqlalchemy] Should 'SAVEPOINT' transaction (i.e.'begin_nested') support be considered usable with SQLite?

2012-10-26 Thread Pedro Romano
Thank you very much for your reply Michael. It confirms my suspicions. --Pedro. On Friday, October 26, 2012 4:17:23 PM UTC+1, Michael Bayer wrote: the short answer is that this is a Pysqlite bug. A short test makes this clear - and here is the bug report for them with a patch:

Re: [sqlalchemy] Idempotence of adding an event listener

2012-07-18 Thread Pedro Romano
Thanks for your thorough reply Michael. The current implementation is perfectly adequate and should definitely not be made more complex to handle corner cases (the class / instance listeners precedence issue had also come to mind). Well designed code won't need to depend on the libraries it

[sqlalchemy] Joined table inheritance and passive deletes

2011-12-15 Thread Pedro Romano
Hi! Tried searching around for information on this topic but couldn't find anything, so here's the question: is it possible to use passive deletes with joined table inheritance? Setting the 'ondelete=CASCADE' on the foreign key declaration of the child class primary key is trivial, however there

[sqlalchemy] Re: Joined table inheritance and passive deletes

2011-12-15 Thread Pedro Romano
Thank you very much for the quick reply and the advice Michael. --Pedro. On Dec 15, 3:27 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 15, 2011, at 4:06 AM, Pedro Romano wrote: Hi! Tried searching around for information on this topic but couldn't find anything, so here's

[sqlalchemy] Column different server function according to dialect possible?

2011-04-21 Thread Pedro Romano
Hi, Is there any way to set a column default to be a different server function depending on the dialect? For python function defaults, this is trivial using a context-sensitive default function and getting the dialect from the context, however these don't cover server functions for defaults,

[sqlalchemy] Different column default server function according to dialect possible?

2011-04-21 Thread Pedro Romano
Hi, Is there any way to set a column default to be a different server function depending on the dialect? For python function defaults, this is trivial using a context-sensitive default function and getting the dialect from the context, however these don't cover server functions for defaults,

[sqlalchemy] Re: Column different server function according to dialect possible?

2011-04-21 Thread Pedro Romano
PLEASE IGNORE... BAD SUBJECT! New post with correct subject. Sorry for the noise. --Pedro. On Apr 21, 12:12 pm, Pedro Romano pmcn...@gmail.com wrote: Hi, Is there any way to set a column default to be a different server function depending on the dialect? For python function defaults

[sqlalchemy] Re: SQLite 'DATETIME' adapter timezone awareness

2010-11-26 Thread Pedro Romano
for Postgresql's TIMESTAMP type which features this option natively.    SQLite's type could support this flag as well so I've added ticket #1985. For now you'd have to subclass sqlite.DATETIME and provide an alternate bind/result processor. On Nov 25, 2010, at 9:03 AM, Pedro Romano wrote

[sqlalchemy] SQLite 'DATETIME' adapter timezone awareness

2010-11-25 Thread Pedro Romano
Needing timezone aware 'DateTime' columns in my 'SQLite' database, I noticed that the aware 'datetime's I was storing in the SQLite database in the 'DateTime(timezone=True)' columns were being stored as naive timestamps without timezone information. I also checked that in the source code