Quantcast
Channel: What is the search_path for a given database and user? - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 4

Answer by Merlin for What is the search_path for a given database and user?

$
0
0
select * from pg_user;

True for postgres and Redshift. This seems too simple compared to the previous answers that depend on pg_db_role_setting, but the useconfig column will have a list of user configs including search_path, formatted as a list.

pg_user Postgres documentation is here

To be more selective:

rs.db.batarang.com cooldb:cooldude =#> select usename                                              , useconfig                                        from   pg_user                                       where  usename = 'cooldude';┌────────────┬─────────────────────────────────────────────────────┐│  usename   │                      useconfig                      │├────────────┼─────────────────────────────────────────────────────┤│ cooldude   │ {"search_path=dirt, test, \"$user\", public, prod"} │└────────────┴─────────────────────────────────────────────────────┘

I think this user table contains all users in the cluster, not just specific db -- but I didn't verify that.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>