Page MenuHomeSoftware Heritage

storage: doc generation fails if postgres dev DB exists
Closed, MigratedEdits Locked

Description

swh-environment/swh-storage/sql $ make doc
createdb softwareheritage-dev
createdb: database creation failed: ERROR:  database "softwareheritage-dev" already exists
make: *** [Makefile:28: createdb-stamp] Error 1

it works fine if the DB is manually removed before doing "make doc".

This seems to be due to this ifndef in the Makefile:

createdb-stamp: $(SQL_FILES)
ifndef PIFPAF
	-dropdb $(DBNAME)
endif
	createdb $(DBNAME)

because PIFPAF is defined in this case (even if I'm running the tests by hand rather than with tox/pifpaf).

As far as I can tell dropdb should be done anyway, and the ifndef should be removed.

Event Timeline

zack triaged this task as Normal priority.Oct 24 2018, 2:11 PM
zack created this task.