Worse yet, dbmail_users.curmail_size is also INT8. So basically we
screwed up and need to figure out how we're going to handle this.

The first workaround might be treating the column as unsigned either by
cast or by funky magic. The proper fix, of course, is to change the
column type to a bigint. I don't want to do this along the stable
series; I suppose we could make this a FAQ and suggest that people who
need this feature change the column type themselves (if you're planning
on handling > 2GB mail per user, you're going to be planning it
carefully and reading the FAQ, or woe be unto you!) For the next major
release with column updates, it won't hurt to change to a bigint for
those who have already made this change, so we'd be safe on that.

Other ideas for working around this? Maybe just ignore it for now?

Aaron

On Fri, 2007-02-16 at 23:00 -0800, Aaron Stone wrote:
> PostgreSQL assigns the type of SUM to be the type of the column it is
> aggregating over. Physmessage.messagesize is INT8, so there we go: we're
> only getting a 32 bit signed value as the sum.
> 
> I'll add an appropriate type cast to the sql fragments in db_get_sql for
> dbpgsql.c, a dummy in dbmysql.c, and look up how SQLite handles this
> data type issue.
> 
> There are actually five places in db.c where a sum is taken over
> physmessage.messagesize, but I think the only negative effect is to
> disable quota checks on mailboxes above 2GB.
> 
> Aaron
> 
> On Thu, 2007-02-15 at 23:54 -0800, Aaron Stone wrote:
> > http://www.linuxforums.org/forum/linux-programming-scripting/54312-postgresql-sum-overflow-error.html
> > 
> > You're on PostgreSQL, right? I wonder if someone has narrowed this
> > report down to either a bug or a subtlty of the column type?
> > 
> > Aaron
> > 
> > On Thu, 2007-02-15 at 13:21 -0500, Matthew T. O'Connor wrote:
> > > Unfortunately in the interim I have deleted a lot of messages from my 
> > > account and now after I run dbmail-util the curmail_size value is again 
> > > positive.  I assume this is because I now have less than 2G in the 
> > > matthew account.  So I do think there is an issue here somewhere, sorry 
> > > I'm not able to help more at the moment.
> > > 
> > > Matt
> > > 
> > > 
> > > Paul J Stevens wrote:
> > > > Running 'dbmail-util -py' at trace_level=5 should reveal what's going on
> > > > here.
> > > > 
> > > > Aaron Stone wrote:
> > > >> On Mon, 2007-02-12 at 00:29 -0500, Matthew T. O'Connor wrote:
> > > >>> I was looking at dbmail_users today and noticed this:
> > > >>>
> > > >>>  user_idnr |             userid             | curmail_size
> > > >>> -----------+--------------------------------+--------------
> > > >>>          4 | matthew                        |  -1886517308
> > > >> That's interesting (to say the least :-P). Internally we've got a 
> > > >> u64_t;
> > > >> I wonder if that's just coming into DBMail as a high 64 bit number or 
> > > >> if
> > > >> something is really screwed up.
> > > >>
> > > >> Aaron
> > > >>
> > > >> _______________________________________________
> > > >> Dbmail-dev mailing list
> > > >> [email protected]
> > > >> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> > > >>
> > > > 
> > >   
> > > _______________________________________________
> > > Dbmail-dev mailing list
> > > [email protected]
> > > http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> > 
> > _______________________________________________
> > Dbmail-dev mailing list
> > [email protected]
> > http://twister.fastxs.net/mailman/listinfo/dbmail-dev

_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to