Skip to content

Commit c8a9153

Browse files
committed
fix(postgresql): return raw column in SQL_BUILD_SELECT_COLS_BY_PK_FMT instead of the encoded value
This query is used during merge conflict resolution to compare local values against incoming changes. Returning encoded bytea caused type mismatches and order-dependent winners in multi-db tests, failing 03_3db_multiple_roundtrip.sql.
1 parent 4b4026f commit c8a9153

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/postgresql/sql_postgresql.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ const char * const SQL_BUILD_SELECT_COLS_BY_PK_FMT =
262262
" SELECT '%s'::text AS colname"
263263
") "
264264
"SELECT "
265-
" 'SELECT cloudsync_encode_value(' || "
266-
" (SELECT format('%%I', colname) FROM col) || "
267-
" ')' "
265+
" 'SELECT ' || (SELECT format('%%I', colname) FROM col) "
268266
" || ' FROM ' || (SELECT tblreg::text FROM tbl)"
269267
" || ' WHERE '"
270268
" || (SELECT string_agg(format('%%I=$%%s', attname, ord), ' AND ' ORDER BY ord) FROM pk)"

0 commit comments

Comments
 (0)