View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - concat function doesn’t exist in PostgreSQL under 9.1 - ProjeQtOr

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

concat function doesn’t exist in PostgreSQL under 9.1

More
27 Nov 2012 14:53 - 27 Nov 2012 14:54 #1 by stephane.clerambault
Hello,

I recently installed Project’Or RIA on debian Squeeze with nginx Web server under postgreSQL 8.4 database. I found some problems in jsonQuery.php because concat function is not declared in this Postgres version.
The concat SQL function is defined for PostgreSQL version >= 9.1.

I patch this file but I don’t know if it is still compatible with MySQL. I don’t know either if you plan to be compatible with this version of Postgres but it can be usefull for other people.
--- a/tool/jsonQuery.php  2012-11-25 21:42:02.000000000 +0100
+++ b/tool/jsonQuery.php  2012-11-26 16:23:46.000000000 +0100
@@ -238,19 +238,19 @@
                  $externalTable = $externalObj->getDatabaseTableName();
                  $externalTableAlias = 'T' . $idTab;
                  if (Sql::isPgsql()) {
-                       $querySelect .= 'concat(';
+                       $querySelect .= '';
                  } else {
                    $querySelect .= 'convert(concat(';
                  }
                  if (property_exists($externalObj,'sortOrder')) {
                    $querySelect .= $externalTableAlias . '.' . $externalObj->getDatabaseColumnName('sortOrder');
-                   $querySelect .=  ",'#split#',";
+                   $querySelect .=  "|| '#split#' ||";
                  }
                  $querySelect .= $externalTableAlias . '.' . $externalObj->getDatabaseColumnName('name');
-                 $querySelect .=  ",'#split#',";
+                 $querySelect .=  "|| '#split#' || ";
                  $querySelect .= $externalTableAlias . '.' . $externalObj->getDatabaseColumnName('color');
                  if (Sql::isPgsql()) {
-                   $querySelect .= ') as "' . $fld .'"';
+                   $querySelect .= ' as "' . $fld .'"';
                  } else {
                    $querySelect .= ') using utf8) as ' . $fld;
                  }
Last edit: 27 Nov 2012 14:54 by stephane.clerambault. Reason: change code bb balise to i

Please Connexion or Create an account to join the conversation.

More
27 Nov 2012 15:16 #2 by babynus
Thanks for pointing out this issue and proposing solution.

Unfortunately ||is not MySql compliant.

I'll look for a workaround dealing with db type to be both compatible.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
27 Nov 2012 16:38 #3 by stephane.clerambault
Is it possible to use if (Sql::isPgsql()) test and a $concatOperator variable set with the right value, '||' for postgres request and ',' for others?

I’am not familiar with php, so it’s just a suggestion!

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.028 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.