Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active August 8, 2021 18:47
Show Gist options
  • Save plembo/627535cbe87caa71f3b36106f3d7e194 to your computer and use it in GitHub Desktop.
Save plembo/627535cbe87caa71f3b36106f3d7e194 to your computer and use it in GitHub Desktop.
Postgres and user search paths

Set the search path for a postgresql user

By default, the search path for a PostgreSQL user is set to the "public" schema. Even if you create a new schema (say, "import") any tables you create in it will not show up in a dt listing of tables without also specifying the schema (e,g,, \dt import.*).

Fix is to update the user's path to include the new schema:

postgres=# alter role myuser set search_path = '$user',public,import;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment