Docker dev database ownership and strange path problems

I ran into this same error… it’s a bit more obscure when you hit it during restore because of the errors about no metadata to extract and cannot restore into different schema make it less obvious that the real problem is FATAL: Peer authentication failed for user "postgres".

Any reason not to update data/postgres/pg_hba.conf method from peer to trust for the default dev image?

The config file has moved, now is:

/etc/postgresql/10/main/pg_hba.conf (inside container)
data/postgres/pg_hba.conf (on host)

When complete, restart the service in the container with:
sv restart postgres

Unfortunately, I’m still unable to complete a restore… After the create index are all complete I’m getting:

[2018-10-19 17:14:32] EXCEPTION: PG::InsufficientPrivilege: ERROR:  permission denied for relation schema_migrations
: SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC

But when I run that query via ./bin/docker/psql I’m just getting an empty set, not a Postgres “Insufficient Priviliges” error…

discourse-# \c discourse_development ;
You are now connected to database "discourse_development" as user "postgres".
discourse_development-# SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
discourse_development-# \c discourse;
You are now connected to database "discourse" as user "postgres".
discourse-# SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC

Maybe there’s something else I should change in pg_hba.conf? @sam