Semantic Drilldown: Bug with PostgreSQL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Semantic Drilldown: Bug with PostgreSQL

Dear List!
I'm runing SMW 2.4.1, with PHP 7.0.7 and PostgreSQL 9.4.9

In the past Yaron was so kind and fixed some bugs I had with
SemanticDrilldown 2.0.2.

Now I found a new one, when I set a filter with type date:
In the file includes/SD_Filter.php line 308 there is a function
getTimePeriodValues() to build the SQL-query-String. Unfortunatly there is
no function YEAR() in PostgreSQL to retrive only the year of a timestamp or
text. YEAR() only exist in MySQL.
I'm pretty sure that EXTRACT() would be the right function for PostgeSQL.
But I'm not able to re-write the code in includes/SD_Filter.php

Here is the SQL-Statement:

SELECT YEAR(SUBSTR(o_serialized, 3, 100)), count(*) FROM
semantic_drilldown_values sdv JOIN "smw_di_time" a ON = a.s_id JOIN
"smw_object_ids" p_ids ON a.p_id = p_ids.smw_id WHERE p_ids.smw_title =
'YearBegin' GROUP BY YEAR(SUBSTR(o_serialized, 3, 100)) ORDER BY
YEAR(SUBSTR(o_serialized, 3, 100))

That's the Error:
42883 ERROR: function year(text) does not exist Line 1

I also reported the bug here [1]
Thanks for help. Bye, Martin

Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
Semediawiki-user mailing list
[hidden email]