[Rt-devel] Daily/Monthly/Annually charts not working with PostgreSQL

Jesse Vincent jesse at bestpractical.com
Fri Jan 2 10:57:10 EST 2009




On Thu, Jan 01, 2009 at 05:59:42PM +0200, Eynat Nir Mishor wrote:
> Hi,
> 
> I've just realized that all the Daily/Monthly/Annually charts (e.g.
> DueDaily) are not working with PostgreSQL from a very primitive reason.
> 
> I was surprised not to find this in the mailing list or Wiki.
> 
>  
> 
> It seems that RT code (RT::Report::Tickets::_ FieldToFunction) assumes that
> the date strings (such as Due, Resolved, etc.) are strings that can be
> manipulated via "SUBSTR" to get their year/year+month/year+month+day.
> 
> This does not work in PostgreSQL where these fields are defined as timestamp
> type.

Interestingly, I believe that at one point Postgres DID automatically
marshal date types into strings. O***cle does. ;) 

I'd absolutely love a patch to make our logic work better on Pg,
especially if it came with the tests we're clearly missing to make sure
nobody ever breaks it again.

-jesse

> 
> It seems "date_part"" or "extract" functions should be used instead.
> 
> I didn't except such DB vendor-specific code in RT.
> 
>  
> 
> Has anyone ran into this problem and/or has a solution before I try to go
> into it myself?
> 
>  
> 
> Thanks,
> 
>  
> 
> Eynat
> 
>  
> 

> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


-- 


More information about the Rt-devel mailing list