I would like to know how to set the current or default schema on redshift. Some documentation I have read states that this is possible with the SET command, but I don't believe this is accurate. I understand the search path can be altered, but I would like to know whether there is another way to set the default schema, something similar to "SET CURRENT_SCHEMA TO 'desired-schema-name'".
Asked
Active
Viewed 1.5k times
1 Answers
8
I don't think there is another way, but altering the search path should be as short to write and functionally be the same as what you're with the difference of one word only (search_path instead of current_schema)
SET search_path TO schema; (from section 5.7.3: https://www.postgresql.org/docs/9.1/static/ddl-schemas.html)
A similar question was answered here and has instructions to permanently set the default search path for individual users or the DB in question: How does the search_path influence identifier resolution and the "current schema"

Community
- 1
- 1

Magnus Lidman
- 81
- 4