Page MenuHomePhabricator

Database error in includes/filerepo/file/LocalFile.php when using PostgreSQL due to time format
Closed, ResolvedPublic

Description

I get the following error on pages with links to uploaded files:

Query:
SELECT  img_metadata  FROM "image"   WHERE img_name = 'ListeAGMitDAN.pdf' AND img_timestamp = '20160908105112'  LIMIT 1  
Function: LocalFile::loadExtraFromDB
Error: 22008 FEHLER: Datum/Zeit-Feldwert ist außerhalb des gültigen Bereichs: „20160908105112“ LINE 1: ...mg_name = 'ListeAGMitDAN.pdf' AND img_timestamp = '201609081... ^ HINT: Möglicherweise benötigen Sie eine andere „datestyle“-Einstellung.

(Date/Time value out of range [...] HINT: You may need another datestyle setting)

I compared the contents of the field img_timestamp to one on a MySql database and there's quite a difference:
MySql: 20160908130558
PostgreSQL: 2016-09-08 13:05:58+02

Unfortunately I didn't find out, which function writes the timestamp to the database, so I have no clue where to start searching.

Using

  • MediaWiki 1.27.1
  • PostgreSql 9.4
  • SLES 11 SP4

Any ideas on what to do?

Thx
Stefan

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.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 8 2016, 12:18 PM
Aklapper renamed this task from Database error in includes/filerepo/file/LocalFile.php when using PostgreSQL to Database error in includes/filerepo/file/LocalFile.php when using PostgreSQL due to time format.

Change 309768 had a related patch set uploaded (by Umherirrender):
Use Database::timestamp in LocalFile::loadFieldsWithTimestamp

https://gerrit.wikimedia.org/r/309768

Umherirrender triaged this task as Normal priority.Sep 10 2016, 8:37 PM
Umherirrender claimed this task.

Change 309768 merged by jenkins-bot:
Use Database::timestamp in LocalFile::loadFieldsWithTimestamp

https://gerrit.wikimedia.org/r/309768

Umherirrender closed this task as Resolved.Sep 11 2016, 7:04 AM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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