Page MenuHomePhabricator

Errors dumping into PostgreSQL database
Closed, DeclinedPublicBUG REPORT

Description

Author: wikipedia

Description:
Move the sqlEscape to MySQLTraits and PostgreSQLTraits + insert anonymous contributor when none is provided in the xml

When dumping a wikinews dump into a PostgreSQL database I encountered several errors concerning mostly the escaping of the strings. I propose a patch in attachment that move the sqlEscape(String) into MySQLTraits and PostgreSQL traits. However a better way would be to use PreparedStatement capabilities of jdbc...

Another error I encountered concerned the presence of a non existing contributor into the XML file getting the whole dump to fail, I instead propose (in the same patch in attachment) to use an anonymous contributor to prevent failing.


Version: unspecified
Severity: normal

attachment mwdumper-postgresql.patch ignored as obsolete

Details

Reference
bz19883

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
DeclinedBUG REPORTNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:40 PM
bzimport set Reference to bz19883.

wikipedia wrote:

I created a new patch that get rids of the TRIGGER prologue in order for the dumping to work even for not super-users in PostgreSQL. This new patch replaces the previous one and can resolve the bug 21548.

wikipedia wrote:

Move the sqlEscape to MySQLTraits and PostgreSQLTraits + defer constraints in PostgreSQL

attachment mwdumper-postgresql-constraints.patch ignored as obsolete

wikipedia wrote:

*** Bug 21548 has been marked as a duplicate of this bug. ***

wikipedia wrote:

Move the sqlEscape to MySQLTraits and PostgreSQLTraits + defer constraints in PostgreSQL

New patch version, the constraints are also deferred at each new checkpoint.

Attached:

brion set Security to None.
Jdforrester-WMF subscribed.

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

wikipedia wrote:

Move the sqlEscape to MySQLTraits and PostgreSQLTraits + defer constraints in PostgreSQL

New patch version, the constraints are also deferred at each new checkpoint.

Attached:

I agree with the patch, tl;dr PostgreSQL requires single quotes to be escaped by a preceding single quote. There might be a better way to dump for postgres however, I'll document in a separate task.

Aklapper changed the subtype of this task from "Task" to "Bug Report".Feb 6 2022, 5:56 PM
hashar subscribed.

mwdumper is no more able to process dump generated since MediaWiki 1.31 (released in June 2018). The tool started in 2005 and is no more maintained, it is thus being archived, see T351228 for reference.