Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have tested Migrate with custom datas, using PostgreSQL.
I encouter this error :
Migration failed with source plugin exception: SQLSTATE[42703]: Undefined column: 7 ERREUR: la colonne d.id n'existe pas [error]
LINE 4: ...UTER JOIN client.public.migrate_map_directory map ON d.ID = map...
^: SELECT d."ID" AS "ID", d."Email" AS "Email", d."Lastname" AS "Lastname", d."Firstname" AS "Firstname",
map.sourceid1 AS migrate_map_sourceid1, map.source_row_status AS migrate_map_source_row_status
FROM
{v2_directory} d
LEFT OUTER JOIN client.public.migrate_map_directory map ON d.ID = map.sourceid1
WHERE ( (map.sourceid1 IS NULL ) OR (map.source_row_status = :db_condition_placeholder_0) ); Array
(
[:db_condition_placeholder_0] => 1
)
I've tested this SQL query in PG, the error is the same.
I've managed to fix the query using quotes (on the "ON" statement), as following :
SELECT d."ID" AS "ID", d."Email" AS "Email", d."Lastname" AS "Lastname", d."Firstname" AS "Firstname",
map.sourceid1 AS migrate_map_sourceid1, map.source_row_status AS migrate_map_source_row_status
FROM
v2_directory d
LEFT OUTER JOIN client.public.migrate_map_directory map ON d."ID" = map.sourceid1
WHERE ( (map.sourceid1 IS NULL ) OR (map.source_row_status = 1) );
Comment | File | Size | Author |
---|---|---|---|
#13 | migrate_fails_to_build-2552547-13.patch | 772 bytes | Haza |
#11 | migrate_fails_to_build-2552547-11.patch | 752 bytes | Nikolay Shapovalov |
#5 | migrate_fails_to_build-2552547-5.patch | 768 bytes | Haza |
Comments
Comment #2
HazaHere is a minor patch that always add quotes around the join.
Comment #3
HazaComment #4
HazaComment #5
HazaOops, just removed the silly string concatenation.
Comment #9
bzrudi71 CreditAttribution: bzrudi71 commentedThanks @Haza! Adding tags and starting PG bot test run.
Comment #10
bzrudi71 CreditAttribution: bzrudi71 commentedComment #11
Nikolay ShapovalovRerolled
Comment #12
bzrudi71 CreditAttribution: bzrudi71 commentedThanks! Can we please make use of Database::escapeField() function instead of simple quoting? It will handle all the required quoting and some other magic for us :-) Please see Connection.php for details...
Comment #13
HazaNew patch that uses the
Database::escapeField()
function.Comment #14
bzrudi71 CreditAttribution: bzrudi71 commentedComment #15
catchComment #16
phenaproximaNice and easy; escaping the field name seems like a great idea in all cases, not just for Postgres support. RTBC!
Comment #17
webchickCommitted and pushed to 8.0.x. Thanks!