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'".
To grant usage of external tables in an external schema, grant USAGE ON SCHEMA to the users that need access. Only the owner of an external schema or a superuser is permitted to create external tables in the external schema. To transfer ownership of an external schema, use ALTER SCHEMA to change the owner.
In computer programming, a schema (pronounced SKEE-mah) is the organization or structure for a database, while in artificial intelligence (AI) a schema is a formal expression of an inference rule. For the former, the activity of data modeling leads to a schema.
A SCHEMA is a logical container for objects such as tables, views, indices, sequences, triggers, functions, aggregates and procedures. Schema access and modification is strictly controlled using the user role and authorization scheme.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With