MantisBT - Piwigo
View Issue Details
0001737Piwigoalbumspublic2010.06.21 23:462010.06.30 00:01
madman 
nikrou 
normalminoralways
closedfixed 
PostgresqlCentOS 5.4Postgresql 8.4.2
2.1.1 
2.1.2 
Mozilla
Postgresql 8.4.2
5.3.2
Apache 2.2.3
0001737: [PostgreSQL/SQlite] Concatenation error
When using the function array_to_string, PostgreSQL returns an error on the Permalink page. This caused by the ARRAY function that requires all datatypes to be the same.

Concatenating columns in PostgreSQL database (and others) can be done with the double pipe: ||.

Please rewrite the pwg_db_concat() function:

function pwg_db_concat($array)
{
  return implode($array, ' || ');
}
New installation -> Administration -> Categories -> Permalinks
Warning: pg_query() [function.pg-query]: Query failed: ERROR: ARRAY types integer and character varying cannot be matched LINE 4: ARRAY_TO_STRING(ARRAY[id,' - ',name]) AS name, ^ in /var/www/sites/fotos.aarjan.nl/piwigo/piwigo_svn/include/dblayer/functions_pgsql.inc.php on line 122
SELECT id, permalink, ARRAY_TO_STRING(ARRAY[id,' - ',name]) AS name, uppercats, global_rank FROM piwigo_categories
ERROR: ARRAY types integer and character varying cannot be matched LINE 4: ARRAY_TO_STRING(ARRAY[id,' - ',name]) AS name, ^
No tags attached.
Issue History
2010.06.21 23:46madmanNew Issue
2010.06.21 23:46madmanbrowser => Mozilla
2010.06.21 23:46madmanMySQL version => Postgresql 8.4.2
2010.06.21 23:46madmanPHP version => 5.3.2
2010.06.21 23:46madmanWeb server => Apache 2.2.3
2010.06.22 09:20plgStatusnew => assigned
2010.06.22 09:20plgAssigned To => nikrou
2010.06.22 23:18svnCheckin
2010.06.22 23:18svnNote Added: 0003989
2010.06.22 23:19svnCheckin
2010.06.22 23:19svnNote Added: 0003990
2010.06.22 23:20nikrouStatusassigned => closed
2010.06.22 23:20nikrouResolutionopen => fixed
2010.06.22 23:20nikrouFixed in Version => 2.1.2
2010.06.30 00:01plgSummaryConcatenation error => [PostgreSQL/SQlite] Concatenation error
2010.06.30 00:01plgAdditional Information Updated

Notes
(0003989)
svn   
2010.06.22 23:18   
[Subversion] r6580 by nikrou on trunk

-----[Subversion commit log]----------------------------------------------------
Bug 1737 fixed : Concatenation error with POstgreSQL
Simplify same function for SQLite
(0003990)
svn   
2010.06.22 23:19   
[Subversion] r6581 by nikrou on branch 2.1

-----[Subversion commit log]----------------------------------------------------
Bug 1737 fixed : merge from trunk
Concatenation error with POstgreSQL
Simplify same function for SQLite