Page MenuHomePhabricator

Errors dumping into PostgreSQL database
Open, NormalPublic

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.
StatusAssignedTask
InvalidNone
OpenNone

Event Timeline

bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz19883.
bzimport created this task.Jul 22 2009, 8:23 PM

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 removed brion as the assignee of this task.Feb 17 2015, 7:31 PM
brion set Security to None.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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

awight added a subscriber: awight.Mar 28 2019, 12:06 AM

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.