Skip to content

Commit

Permalink
fix: create index no statement timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeeva committed Nov 26, 2024
1 parent c80c24b commit 137b855
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pgbelt/util/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ async def create_target_indexes(
index = regex_matches.groupdict()["index"]

# Create the index
command = ["psql", config.dst.owner_dsn, "-c", f"{c};"]
# Note that the host DSN must have a statement timeout of 0.
# Example DSN: `host=server-hostname user=user dbname=db_name options='-c statement_timeout=3600000'`
host_dsn = config.dst.owner_dsn + " options='-c statement_timeout=0'"
command = ["psql", host_dsn, "-c", f"{c};"]
logger.info(f"Creating index {index} on the target...")
try:
await _execute_subprocess(
Expand Down

0 comments on commit 137b855

Please sign in to comment.