On Jun 14, 2007, at 6:21 AM, Daniele Varrazzo wrote:
> > Hello, > > partitioned tables in PostgreSQL don't report the correct number of > updated rows, so updates from a mapper fail. Reported by Antonio on > the postgresql-it mailing list. > > An obvious fix is reported below, i don't know if there is a better > way to fix it. Furthermore i didn't check for inserts and deletes (if > you wish i could: i just set up the reported db schema: i can ask the > OP a complete example of partitioned table). > > Cheers, > > -- Daniele > > --- sqlalchemy/databases/postgres.py.bak 2007-06-14 12:02:40 +0200 > +++ sqlalchemy/databases/postgres.py 2007-06-14 12:02:30 +0200 > @@ -283,6 +283,10 @@ > else: > return sqltypes.adapt_type(typeobj, pg1_colspecs) > > + def supports_sane_rowcount(self): > + # It fails for updates on partitioned tables. > + return False > + > def compiler(self, statement, bindparams, **kwargs): > return PGCompiler(self, statement, bindparams, **kwargs) as this issue just was mentioned the other day, the SA workaround would be a dialect-level flag to have sane_rowcount return False when the flag is set. we definitely arent having it return False in all cases, since "partioned tables" are not a common use case. an even better fix would be to include the flag on Table items themselves, and propigate that through. patches for either of those two approaches will be accepted. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---