pgbelt 0.7.4__py3-none-any.whl → 0.7.6__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/cmd/login.py CHANGED
@@ -55,7 +55,12 @@ async def revoke_logins(config_future: Awaitable[DbupgradeConfig]) -> None:
55
55
  await _populate_logins(conf.src, pool, logger)
56
56
  save_task = asyncio.create_task(conf.save())
57
57
 
58
- to_disable = [conf.src.owner_user.name]
58
+ to_disable = []
59
+ # Sometimes the owner user is the same as the root user.
60
+ # When that happens, we don't want to disable the owner user.
61
+ # If the owner user is different, we want to disable the owner user.
62
+ if conf.src.owner_user.name != conf.src.root_user.name:
63
+ to_disable.append(conf.src.owner_user.name)
59
64
 
60
65
  if conf.src.other_users is not None:
61
66
  to_disable += [
pgbelt/cmd/teardown.py CHANGED
@@ -42,13 +42,13 @@ async def teardown_forward_replication(config_future: Awaitable[DbupgradeConfig]
42
42
  @run_with_configs
43
43
  async def teardown(
44
44
  config_future: Awaitable[DbupgradeConfig],
45
- full: bool = Option(False, help="Remove pglogical user and extension"),
45
+ full: bool = Option(False, help="Remove pglogical extension"),
46
46
  ):
47
47
  """
48
48
  Removes all pglogical configuration from both databases. If any replication is
49
- configured this will stop it.
49
+ configured this will stop it. It will also drop the pglogical user.
50
50
 
51
- If run with --full the pglogical users and extension will be dropped.
51
+ If run with --full the pglogical extension will be dropped.
52
52
 
53
53
  WARNING: running with --full may cause the database to lock up. You should be
54
54
  prepared to reboot the database if you do this.
pgbelt/util/postgres.py CHANGED
@@ -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.4
3
+ Version: 0.7.6
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
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: aiofiles (>=0.8,<23.3)
13
+ Requires-Dist: aiofiles (>=0.8,<24.2)
14
14
  Requires-Dist: asyncpg (>=0.27,<0.30)
15
15
  Requires-Dist: pydantic (>=2.0,<3.0)
16
16
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
@@ -2,13 +2,13 @@ pgbelt/__init__.py,sha256=0FxxDo2hLiQpxjY5NS48g2XC_nRMKPJf5X0aGIxmMo4,137
2
2
  pgbelt/cmd/__init__.py,sha256=28SxbIChyvJ1mLoI8XJQPrPPwKA6852V9jtnFm8R0Nw,462
3
3
  pgbelt/cmd/convenience.py,sha256=RY762BYoyOccmhHqSOaHWIPVBzY4kU0qZautTprGps0,5857
4
4
  pgbelt/cmd/helpers.py,sha256=anMAkZjJRy7n0EwewyMNJGJ4Jx9keSNZdzWqi3ICNgI,5292
5
- pgbelt/cmd/login.py,sha256=kyDT755YsScg3QA4ZlkyIq3J0WO4XqMepMchufjuaDE,3043
5
+ pgbelt/cmd/login.py,sha256=FNg7shEIC2iwiDjOMza2ZvBv_33U1GMKRh51vsGMTb8,3351
6
6
  pgbelt/cmd/preflight.py,sha256=-78Puqqf1rCxNQEyn4bQIAORez_tsy6zJAbSuO_de9s,20676
7
7
  pgbelt/cmd/schema.py,sha256=XAAj2BH6HVoA1LxuWw2kheesGDu41L3GAd5UahNp3nE,4760
8
8
  pgbelt/cmd/setup.py,sha256=Jp5sqT9_whoVBiOzAlOzX1ubtXQADYBkBrJldch_fKk,6627
9
9
  pgbelt/cmd/status.py,sha256=LTvteFwA1jcfnGJdlA2siJn5TUtlf14ffMkGVSi5gi0,4730
10
10
  pgbelt/cmd/sync.py,sha256=8TSNbn1dpkyxlEMImY7FjOrzhriSXlorqE-HBjqbUfU,9027
11
- pgbelt/cmd/teardown.py,sha256=TTSmhmD1bqJ8-P5YyK5ZpCsmneczO0nvd2Q2s2oyXY4,3526
11
+ pgbelt/cmd/teardown.py,sha256=Nl37vpugxO7QHO0tKpTfZDV0KtsSm0SbWUbzb3k2N-0,3545
12
12
  pgbelt/config/__init__.py,sha256=SXok1aZcpMYJpX_hk5cuKO33CJ5s8IESkswNN9KsVSo,35
13
13
  pgbelt/config/config.py,sha256=Kw2H-G1Evfj0TXIbh3k06gE72dZEp_wXWJ2Icq_T54c,3817
14
14
  pgbelt/config/models.py,sha256=YnsBYAa5hC-hcrbgd0-rYcpYYc4oU-cq7sRy0RsudY0,6357
@@ -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.4.dist-info/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
24
- pgbelt-0.7.4.dist-info/METADATA,sha256=9sf3BPo7Iq4P2yIpeDbA8ArZUKhg6Yo29V5fTuixQE4,2960
25
- pgbelt-0.7.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
- pgbelt-0.7.4.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
27
- pgbelt-0.7.4.dist-info/RECORD,,
22
+ pgbelt/util/postgres.py,sha256=8hWr-vZQpr_NyhUUag9gYgnJqzGX8QPo3Eber7Ze_30,19443
23
+ pgbelt-0.7.6.dist-info/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
24
+ pgbelt-0.7.6.dist-info/METADATA,sha256=zl8yF81Vtkzj_fC-GqpsSc8j4R4-NJiykwekhr_IKfA,2960
25
+ pgbelt-0.7.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
+ pgbelt-0.7.6.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
27
+ pgbelt-0.7.6.dist-info/RECORD,,
File without changes