Page MenuHomePhabricator

rebuildrecentchanges.php fails on PostgreSQL
Closed, ResolvedPublic

Description

]$ php rebuildrecentchanges.php
Loading from CUR table...

Warning: pg_query(): Query failed: ERROR: function if(smallint, integer,
integer) does not exist
HINT: No function matches the given name and argument types. You may need to
add explicit type casts. in /var/www/html/gres/includes/DatabasePostgreSQL.php
on line 96
A database error has occurred
Query: INSERT INTO recentchanges
(rc_timestamp,rc_cur_time,rc_user,rc_user_text,rc_namespace,rc_title,rc_comment,rc_minor,rc_bot,rc_new,rc_cur_id,rc_this_oldid,rc_last_oldid,rc_type)
SELECT
cur_timestamp,cur_timestamp,cur_user,cur_user_text,cur_namespace,cur_title,cur_comment,cur_minor_edit,0,cur_is_new,cur_id,0,0,IF(cur_is_new,1,0)
FROM cur
Function: rebuildRecentChangesTablePass1
Error: 1 ERROR: function if(smallint, integer, integer) does not exist
HINT: No function matches the given name and argument types. You may need to
add explicit type casts.

Backtrace:
DatabasePostgreSQL.php line 370 calls wfDebugDieBacktrace()
Database.php line 297 calls DatabasePostgreSQL::reportQueryError()
Database.php line 1034 calls DatabasePostgreSQL::query()
rebuildrecentchanges.inc line 38 calls DatabasePostgreSQL::insertSelect()
rebuildrecentchanges.php line 19 calls rebuildRecentChangesTablePass1()


Version: 1.4.x
Severity: normal

Details

Reference
bz407

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:53 PM
bzimport set Reference to bz407.
bzimport added a subscriber: Unknown Object (MLST).

Modified Files:
includes/Database.php includes/DatabasePostgreSQL.php
maintenance/rebuildrecentchanges.inc
maintenance/postgresql/pg_tables.sql
Log Message:
Add Database::conditional() function to build IF() or CASE statements
depending on the RDBMS used. Allowed NULL in some RC fields on PostgreSQL.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.