Last modified: 2014-04-22 19:38:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 61318 - Postgres installation fails (null value in column "rc_cur_time" violates not-null constraint)
Postgres installation fails (null value in column "rc_cur_time" violates not-...
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
All All
: High normal (vote)
: 1.23.0 release
Assigned To: Jeff Janes
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2014-02-13 16:14 UTC by Ocean behind ears
Modified: 2014-04-22 19:38 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

proposed and tested fix (1.86 KB, patch)
2014-04-17 04:37 UTC, Jeff Janes

Description Ocean behind ears 2014-02-13 16:14:39 UTC
While trying to install Mediawiki through Postgres the installer constantly failed, throwing the error:
Could not insert main page: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: Query: INSERT INTO "recentchanges" (rc_timestamp,rc_namespace,rc_title,rc_type,rc_source,rc_minor,rc_cur_id,rc_user,rc_user_text,rc_comment,rc_this_oldid,rc_last_oldid,rc_bot,rc_ip,rc_patrolled,rc_new,rc_old_len,rc_new_len,rc_deleted,rc_logid,rc_log_type,rc_log_action,rc_params,rc_id) VALUES ('2014-02-13 16:13:55 GMT','0','Main_Page','1','','0','2','0','MediaWiki default','','2','0','0','','0','1','0','524','0','0',NULL,'','','2') Function: RecentChange::save Error: 23502 ERROR: null value in column "rc_cur_time" violates not-null constraint
even though databases were cleared out.
Comment 1 Ocean behind ears 2014-02-13 16:19:47 UTC
This was found using postgres 9.1.11
Comment 2 Ocean behind ears 2014-02-13 17:42:30 UTC
Git bisect found commit 974562aee92a78be82cf8e1416ef44648bb7dbb7 to be the cause of the bug
Comment 3 Jeff Janes 2014-04-17 04:37:15 UTC
Created attachment 15127 [details]
proposed and tested fix

For mysql this column is not null but now defaults to some magic value which means the same as NULL.  For PostgreSQL, I'd recommend just dropping the NOT NULL constraint and letting new entries default to null.  This patch does that for both new installs and upgrades.
Comment 4 Andre Klapper 2014-04-17 10:07:38 UTC
Hi! Thanks for your patch!

You are welcome to use Developer access
to submit this as a Git branch directly into Gerrit:

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use
Thanks again! We appreciate your contribution.
Comment 5 Gerrit Notification Bot 2014-04-20 22:27:33 UTC
Change 127586 had a related patch set uploaded by Jjanes:
PostgreSQL: Allow rc_cur_time field to be null.
Comment 6 Gerrit Notification Bot 2014-04-22 16:57:52 UTC
Change 128946 had a related patch set uploaded by Jjanes:
PostgreSQL: Allow rc_cur_time field to be null.
Comment 7 Gerrit Notification Bot 2014-04-22 18:59:38 UTC
Change 128946 merged by jenkins-bot:
PostgreSQL: Allow rc_cur_time field to be null.
Comment 8 Gerrit Notification Bot 2014-04-22 19:36:18 UTC
Change 127586 merged by jenkins-bot:
PostgreSQL: Allow rc_cur_time field to be null.
Comment 9 Bartosz Dziewoński 2014-04-22 19:38:48 UTC
Merged into master and backported to 1.23 release.

Note You need to log in before you can comment on or make changes to this bug.