[open-ils-commits] r13192 - trunk/Open-ILS/src/perlmods/OpenILS/Reporter (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri May 15 17:51:45 EDT 2009
Author: dbs
Date: 2009-05-15 17:51:40 -0400 (Fri, 15 May 2009)
New Revision: 13192
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm
Log:
LPAD() demands that its first parameter be TEXT in PostgreSQL 8.3; cast accordingly
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm 2009-05-15 21:17:30 UTC (rev 13191)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm 2009-05-15 21:51:40 UTC (rev 13192)
@@ -395,7 +395,7 @@
$val =~ s/'/\\'/go;
return "EXTRACT(YEAR FROM '$rtime'::TIMESTAMPTZ + '$val months')" .
- " || '-' || LPAD(EXTRACT(MONTH FROM '$rtime'::TIMESTAMPTZ + '$val months'),2,'0')";
+ " || '-' || LPAD(EXTRACT(MONTH FROM '$rtime'::TIMESTAMPTZ + '$val months')::text,2,'0')";
}
@@ -721,7 +721,7 @@
sub toSQL {
my $self = shift;
return 'EXTRACT(YEAR FROM "' . $self->{_relation} . '"."' . $self->name . '")' .
- ' || \'-\' || LPAD(EXTRACT(MONTH FROM "' . $self->{_relation} . '"."' . $self->name . '"),2,\'0\')';
+ ' || \'-\' || LPAD(EXTRACT(MONTH FROM "' . $self->{_relation} . '"."' . $self->name . '")::text,2,\'0\')';
}
sub is_aggregate { return 0 }
More information about the open-ils-commits
mailing list