Added --no-superuser flag

To allow import into already existing databases.
Refs: #2719
This commit is contained in:
Robbe Haesendonck
2023-09-19 16:19:11 +02:00
committed by Sarah Hoffmann
parent 3c32c0354a
commit ba5ec80611
2 changed files with 7 additions and 3 deletions

View File

@@ -65,6 +65,8 @@ class SetupAll:
help='Continue import even when errors in SQL are present')
group3.add_argument('--index-noanalyse', action='store_true',
help='Do not perform analyse operations during index (expert only)')
group3.add_argument('--no-superuser', action='store_true',
help='Do not attempt to create the database')
def run(self, args: NominatimArgs) -> int: # pylint: disable=too-many-statements
@@ -81,9 +83,10 @@ class SetupAll:
if not files:
raise UsageError("No input files (use --osm-file).")
LOG.warning('Creating database')
database_import.setup_database_skeleton(args.config.get_libpq_dsn(),
rouser=args.config.DATABASE_WEBUSER)
if not args.no_superuser:
LOG.warning('Creating database')
database_import.setup_database_skeleton(args.config.get_libpq_dsn(),
rouser=args.config.DATABASE_WEBUSER)
LOG.warning('Setting up country tables')
country_info.setup_country_tables(args.config.get_libpq_dsn(),