Jump to content

Topic on Extension talk:FlaggedRevs/archive 4

FlaggedRevs & PostgreSQL 10

5
Summary by Pglind

A code change resolved the issue.

Pglind (talkcontribs)

Hi team,

We are using MediaWiki 1.37.1 on PostgreSQL 10 with FlaggedRevs (tested branch REL1_37 & wmf/1.37.0-wmf.9).

Unfortunately when adding a new Wiki page we receive an error:


[22c5ffc28c0120bd38673b6d] /index.php?title=Testpagina&action=submit Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?

Please see link and link for more information.

Error 22007: ERROR: invalid input syntax for type timestamp with time zone: "" LINE 1: ... WHERE fr_page_id = 268 AND (fr_rev_timestamp > ) AND (r... ^

Function: FlaggableWikiPage::updatePendingList

Query: SELECT fr_rev_id,rev_timestamp FROM "flaggedrevs","revision" WHERE fr_page_id = 268 AND (fr_rev_timestamp > ) AND (rev_id = fr_rev_id) AND (rev_page = fr_page_id) AND ((rev_deleted & 1) = 0) ORDER BY fr_rev_timestamp DESC LIMIT 1


Trying the query myself in PG, I receive the same error, however after more investigation, this is the issue:

AND (fr_rev_timestamp > '')


I have tried to run the php maintenance/update.php multiple times, but always succeeds without issues and no changes.


I also couldn't find a mention anywhere on the Extensions page that PostgreSQL isn't supported.


What can I do to resolve this?


Thank you

Tacsipacsi (talkcontribs)

I don’t know whether Postgres is officially supported (the whole extension as such is rather unsupported, though), however this seems to be a bug not directly related to PostgreSQL: comparing a timestamp with the empty string simply doesn’t make any sense; I wonder why MariaDB doesn’t cry about this. It was set to the empty string by Ladsgroup in phab:rEFLR04ffb5f56f2331138f2463584aacbb702e8d243e, maybe they can tell whether that filter is still needed and if yes, how to fix it in Postgres.

Ladsgroup (talkcontribs)

Sorry for this error. Let us see how this can be fixed.

Ladsgroup (talkcontribs)
Pglind (talkcontribs)

Thank you for looking into this!

Removing the line from the file as seen in the commit fixes the issue :)