IGNORE THIS QUESTION. LEAVING IT HERE IN CASE ANOTHER IDIOT LIKE ME HAS THE SAME PROBLEM.
This seems like such a stupid problem.
I’m trying to import the database scheme for postgresql from /usr/share/openfire/resources/database/openfire_postgresql.sql
When I try to import as root
root> psql -d myopenfiredb -f /usr/share/openfire/resources/database/openfire_postgresql.sql
the error I get is that “root” is not a defined role in the database
When I try to import as postgres
postgres> psql -d myopenfiredb -f /usr/share/openfire/resources/database/openfire_postgresql.sql
I get a permission denied error to access the sql file
I tried doing
chown postgres:postgres for openfire_postgresql.sql, but it still gave me a permission denied
So anyway I ended up adding my linux username (lets call it UbuntuMainUser) as a postgres user, granting all privileges to the openfire database, and then copying the openfire_postgresql.sql file to my UbuntuMainUser home directory, and then doing the import from there.