pgbelt 0.7.5__py3-none-any.whl → 0.7.7__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
@@ -15,9 +15,9 @@ async def dump_sequences(
15
15
  # Get all sequences in the schema
16
16
  seqs = await pool.fetch(
17
17
  f"""
18
- SELECT '{schema}' || '.' || sequence_name
18
+ SELECT '{schema}' || '.\"' || sequence_name
19
19
  FROM information_schema.sequences
20
- WHERE sequence_schema = '{schema}';
20
+ WHERE sequence_schema = '{schema}' || '\"';
21
21
  """
22
22
  )
23
23
 
@@ -28,7 +28,7 @@ async def dump_sequences(
28
28
  proper_sequence_names = []
29
29
  for seq in targeted_sequences:
30
30
  if f"{schema}." not in seq:
31
- proper_sequence_names.append(f"{schema}.{seq}")
31
+ proper_sequence_names.append(f'{schema}."{seq}"')
32
32
  else:
33
33
  proper_sequence_names.append(seq)
34
34
  targeted_sequences = proper_sequence_names
@@ -54,6 +54,12 @@ async def load_sequences(pool: Pool, seqs: dict[str, int], logger: Logger) -> No
54
54
  given a dict of sequence named mapped to values, set each sequence to the
55
55
  matching value
56
56
  """
57
+
58
+ # If seqs is empty, we have nothing to do. Skip the operation.
59
+ if not seqs:
60
+ logger.info("No sequences to load. Skipping sequence loading.")
61
+ return
62
+
57
63
  logger.info(f"Loading sequences {list(seqs.keys())}...")
58
64
  sql_template = "SELECT pg_catalog.setval('{}', {}, true);"
59
65
  sql = "\n".join([sql_template.format(k, v) for k, v in seqs.items()])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pgbelt
3
- Version: 0.7.5
3
+ Version: 0.7.7
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
  Author: Varjitt Jeeva
6
6
  Author-email: varjitt.jeeva@autodesk.com
@@ -19,9 +19,9 @@ pgbelt/util/asyncfuncs.py,sha256=7i_GpBmUNNZ8RUGvU-q5nclsoaCm6Lx8jLP8usYvmZc,583
19
19
  pgbelt/util/dump.py,sha256=AwyOAd9CP014gvsl-qlo1lbnXZfxoeN4ujZWUIq7KM8,14715
20
20
  pgbelt/util/logs.py,sha256=l2jT-WKZ-33eNDw4S4W1_eE4ISo4rtDRXYLVf4QTV4Y,1699
21
21
  pgbelt/util/pglogical.py,sha256=Y6KZBeiH85zhNSvhATqh0xozhfUMyQnPWN1HwRosZFo,13613
22
- pgbelt/util/postgres.py,sha256=jNMYhkb4OHYhNzDu7Fppz8wrXogAw1XxVhxdBA2e6cI,19270
23
- pgbelt-0.7.5.dist-info/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
24
- pgbelt-0.7.5.dist-info/METADATA,sha256=-kYS6lLQlXAkSD5snpRYcHb78yPlmfWeAbGlKXMVwPM,2960
25
- pgbelt-0.7.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
- pgbelt-0.7.5.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
27
- pgbelt-0.7.5.dist-info/RECORD,,
22
+ pgbelt/util/postgres.py,sha256=KtCvtWbccJ9McosBUt5vkVtlyNrCJRSKpQyh7dbvc84,19455
23
+ pgbelt-0.7.7.dist-info/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
24
+ pgbelt-0.7.7.dist-info/METADATA,sha256=CEMErstcTrOFaUY-KpxZgk2a1MaFmv4Gx8GO6_2ybLs,2960
25
+ pgbelt-0.7.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
+ pgbelt-0.7.7.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
27
+ pgbelt-0.7.7.dist-info/RECORD,,
File without changes