Skip to content

Commit 9ab3f89

Browse files
authored
Merge pull request #1979 from geofabrik/osm2pgsql-repl-no-db-error-msg
If there's an init error, and no -d option specified, use the actual database name, rather than "None"
2 parents d396038 + 04dab0e commit 9ab3f89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/osm2pgsql-replication

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ def main():
550550

551551
try:
552552
if not table_exists(conn, f'{args.prefix}_ways'):
553-
LOG.fatal(f'osm2pgsql middle table "{args.prefix}_ways" not found in database "{args.database}". '
553+
dbname = conn.get_dsn_parameters()['dbname'] # args.database is None when not specified
554+
LOG.fatal(f'osm2pgsql middle table "{args.prefix}_ways" not found in database "{dbname}". '
554555
'Database needs to be imported in --slim mode.')
555556
return 1
556557

0 commit comments

Comments
 (0)