pgbelt 0.9.3__py3-none-any.whl → 0.9.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pgbelt/util/postgres.py CHANGED
@@ -326,6 +326,21 @@ async def compare_tables_without_pkeys(
326
326
  elif isinstance(value, bytes):
327
327
  hex_val = value.hex()
328
328
  where_clauses.append(f"\"{key}\" = '\\x{hex_val}'")
329
+ elif isinstance(value, list):
330
+ # Handle PostgreSQL arrays - format as '{val1, val2, ...}'
331
+ # Need this and not in the PK comparison because these rows are compared by row here only, not by row there also broken by column.
332
+ escaped_elements = []
333
+ for elem in value:
334
+ if elem is None:
335
+ escaped_elements.append("NULL")
336
+ else:
337
+ # Escape double quotes and backslashes in array elements
338
+ escaped_elem = (
339
+ str(elem).replace("\\", "\\\\").replace('"', '\\"')
340
+ )
341
+ escaped_elements.append(f'"{escaped_elem}"')
342
+ array_literal = "{" + ",".join(escaped_elements) + "}"
343
+ where_clauses.append(f"\"{key}\" = '{array_literal}'")
329
344
  else:
330
345
  # Escape single quotes in string values
331
346
  escaped_val = str(value).replace("'", "''")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pgbelt
3
- Version: 0.9.3
3
+ Version: 0.9.4
4
4
  Summary: A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
5
5
  License-File: LICENSE
6
6
  Author: Varjitt Jeeva
@@ -19,9 +19,9 @@ pgbelt/util/asyncfuncs.py,sha256=7i_GpBmUNNZ8RUGvU-q5nclsoaCm6Lx8jLP8usYvmZc,583
19
19
  pgbelt/util/dump.py,sha256=J0TXPv4LfsrRnt4ppVgxFK_E9tTueLcsAY4PQLVKXAI,15172
20
20
  pgbelt/util/logs.py,sha256=3Kk_dERXLsTwLxFS6tzI8fE0sRi5QrBYHJc4Al6ZCMA,2110
21
21
  pgbelt/util/pglogical.py,sha256=Y6KZBeiH85zhNSvhATqh0xozhfUMyQnPWN1HwRosZFo,13613
22
- pgbelt/util/postgres.py,sha256=xPg2jNaYrNsnxGi5fNUJgi2xH_AvCcAZQV_jAXN-5tc,23596
23
- pgbelt-0.9.3.dist-info/METADATA,sha256=u141LbxKqgU4GKTfrY-6OL8nYTKM-pFy0MZyd_2pzvM,2933
24
- pgbelt-0.9.3.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
25
- pgbelt-0.9.3.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
26
- pgbelt-0.9.3.dist-info/licenses/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
27
- pgbelt-0.9.3.dist-info/RECORD,,
22
+ pgbelt/util/postgres.py,sha256=poUA8PJ71OJZupfCh7k-7qBAwVxocJYAzhZ2NajSfxk,24551
23
+ pgbelt-0.9.4.dist-info/METADATA,sha256=1MA0qdMJ1lDd_LQ1DO9xzJLybhVcC3AH9iUU0MjSgC4,2933
24
+ pgbelt-0.9.4.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
25
+ pgbelt-0.9.4.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
26
+ pgbelt-0.9.4.dist-info/licenses/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
27
+ pgbelt-0.9.4.dist-info/RECORD,,
File without changes