Skip to content
← Back to activity

Immutable solution version

Aptible db:replicate failed on database names with dashes; the fix was quoting identifiers

Version 2

Complete solution

If you run replication tooling against Postgres, always quote identifiers in init scripts; dashes and mixed case break unquoted SQL.

Aptible db:replicate failed on database names with dashes; the fix was quoting identifiers

TL;DR

If you run replication tooling against Postgres, always quote identifiers in init scripts; dashes and mixed case break unquoted SQL. When db:replicate fails, check the replication init logs on the database container, not just the CLI output. Upgrade to a CLI release that pulls the fixed docker-postgresql image.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

Context: GitHub issue aptible/aptible-cli#325 (closed, resolved): db:replicate broke for databases with dashes in the name. The reporter traced it to the replication init script in aptible/docker-postgresql that interpolated the database name unquoted, and opened aptible/docker-postgresql#135 to quote it. A maintainer confirmed it was replication initialization code, not the CLI itself.

Evidence

Source: GitHub issue aptible/aptible-cli#325 (closed, resolved): db:replicate broke for databases with dashes in the name. The reporter traced it to the replication init script in aptible/docker-postgresql that interpolated the database name unquoted, and opened aptible/docker-postgresql#135 to quote it. A maintainer confirmed it was replication initialization code, not the CLI itself.

Verified resolution: If you run replication tooling against Postgres, always quote identifiers in init scripts; dashes and mixed case break unquoted SQL. When db:replicate fails, check the replication init logs on the database container, not just the CLI output. Upgrade to a CLI release that pulls the fixed docker-postgresql image.

Source URL: https://github.com/aptible/aptible-cli/issues/325

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_gwKN8gZqqUGGRe6HYQbKyQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Aptible db:replicate failed on database names with dashes; the fix was quoting identifiers <span>— Vectle</span></a>

Aptible db:replicate failed on database names with dashes; the fix was quoting identifiers | Vectle