PG_VERSION = 9.0
While using statustics page for 'cdr report', 'RED TOTAL BAR TABLE' at the bottom not displayed.
Here is part of /var/log/message:
Apr 5 10:22:37 server postgres: [2-1] ERROR: function pg_catalog.substring(timestamp with time zone, integer, integer) does not exist at character 8
Apr 5 10:22:37 server postgres: [2-2] HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Apr 5 10:22:37 server postgres: [2-3] STATEMENT: SELECT substring(calldate,1,10) AS day, sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE (calldate) >= ('2012-01-01') AND (calldate) <= ('2012-03-31 23:59:59') GROUP BY substring(calldate,1,10)
Fix: patch file attached
Patch attached with submission follows:
Choose any period and click search.
Even better - optimized query with order:
$QUERY = "SELECT cast(calldate as date) AS day, sum(duration) AS
calltime, count(*) as nbcall FROM cdr WHERE ".$FG_TABLE_CLAUSE." GROUP
BY cast(calldate as date) order by 1 desc"; //extract(DAY from calldate)
ports PR. The 'www' category is for problems with the FreeBSD.org
I am assuming you didn't get a copy of this, due to the original
submitters mistaken category.
Please check this patch, and decide if you want to approve it.
I would suggest a PORTREVISION bump (at least), and if this patch is
needed, send it upstream?
Michael Scheidell, CTO
>*| * SECNAP Network Security Corporation
I'll take it. Maintainer feedback timeout.
For audit, could everyone please test the attached patch?
(curl 'http://www.freebsd.org/cgi/query-pr.cgi?pr=ports%2F166662&getpatch=2' | patch -EuNI)
Veselin: to avoid confusion, this appears to apply your second QUERY.
jfkimura: do you approve this patch?
(note, I did bump PORTREVISION, this will force a rebuild for mysql as well as pgsql users, but it looks like this is the
safest thing to do)
Michael Scheidell, CTO
SECNAP Network Security Corporation
This email has been scanned and certified safe by SpammerTrap(r).
For Information please see http://www.spammertrap.com/
Ask for maintainer approval.
No response. Don't know what submitter or maintainer wants to do.
scheidell 2012-06-09 11:10:50 UTC
FreeBSD ports repository
- Fix pgsql select substring() problem
- pet portlint (gd.4 to gd.[4-9] in LIB_DEPENDS)
- Bump PORTREVISION
Submitted by: Veselin Slavov <firstname.lastname@example.org>
Reviewed by: scheidell@ (me)
Approved by: F. Kimura <email@example.com> (maintainer)
Revision Changes Path
1.15 +3 -2 ports/www/asterisk-stat/Makefile
1.1 +9 -0 ports/www/asterisk-stat/files/pgsql__patch-call.log.php (new)
firstname.lastname@example.org mailing list
To unsubscribe, send any mail to "email@example.com"
-------- Original Message --------
Subject: Re: ports/166662: www/asterisk-stat - pgsql select substring()
Date: Sat, 9 Jun 2012 16:04:48 +0900
From: F. Kimura <firstname.lastname@example.org>
Reply-To: F. Kimura <email@example.com>
To: scheidell@FreeBSD.org <scheidell@FreeBSD.org>, firstname.lastname@example.org
I was not using e-mail for a month. Sorry. If possible, I want to accept this PR.
// Fumihiko Kimura