Even though I'm (apparently) setting the search_path correctly I still have to prefix everything with the schema. What's wrong here? How do I get a default schema from the search_path?
psql blip
psql (9.4.1, server 9.4.4)
Type "help" for help.
blip=> \dt messages
no matching relations found.
blip=> \dt blip_schema.messages
List of relations
Schema | Name | Type | Owner
-------------+----------+-------+--------
blip_schema | messages | table | dbuser
(1 row)
blip=> set search_path to "blip_schema,public";
SET
blip=> show search_path;
search_path
----------------------
"blip_schema,public"
(1 row)
blip=> \dt messages
No matching relations found.
blip=> \dt blip_schema.messages
List of relations
Schema | Name | Type | Owner
-------------+----------+-------+--------
blip_schema | messages | table | dbuser
(1 row)
Best Answer
Double quotes denote identifiers that contain special characters, so
set search_path to "blip_schema,public"
will set the search path to a single schema namedblip_schema,public
.The names you supply to
set search_path
have to follow regular naming rules, so no quotes at all, unless you have one schema that requires quoting:or if you do want to use quotes, you need them for each identifier: