whysthatso

Problems With Search_path In Postgres 16

Posted on July 3, 2025

I discovered that for some reason default search paths in some of my postgres 16 schemas were way off.

SELECT r.rolname, d.datname, rs.setconfig
FROM   pg_db_role_setting rs
LEFT   JOIN pg_roles      r ON r.oid = rs.setrole
LEFT   JOIN pg_database   d ON d.oid = rs.setdatabase
WHERE  r.rolname = 'immich' OR d.datname = 'immich';

this shows the defaults in the current schema, here it was immich db and user, but for some reason it had mattermost as a result.

alter database immich set search_path = "$user", public ;

fixed this

Hey! I'll happily receive your comments via email. Thanks for reading.

Andreas Wagner
freelance System Administrator and Ruby programmer in Tallinn, Estonia