No Schema Has Been Selected to Create in ... Error

No schema has been selected to create in ... error

no schema has been selected to create in

You get this error when your search_path setting has no valid first entry (typically empty). Postgres does not know in which schema to create the table.

Fix your search_path setting, or schema-qualify object names (like: public.users). But fix your search_path in any case.

Details:

  • How does the search_path influence identifier resolution and the "current schema"

Hasura Computed no schema has been selected to create in. null

You need to either fully qualify the schema where the function should be created eg public.author_full_name or update the search path in Postgres so that it defaults to a schema (public or otherwise)

See the answer here https://stackoverflow.com/a/41207765/1364771

How to select schema to create table in PostgreSQL

I suspect it is the uppercase schema name that is causing the issues.

test=# set search_path to WSI;
SET
test=# show search_path;
search_path
-------------
wsi
(1 row)

test=# create table myt (id integer);
ERROR: no schema has been selected to create in
LINE 1: create table myt (id integer);
^
test=# set search_path to "WSI";
SET
test=# show search_path;
search_path
-------------
"WSI"
(1 row)

test=# create table myt (id integer);
CREATE TABLE

rake db:migrate - PG:: InvalidSchamaName ERROR: no schema has been selected to create in

For some reason there was no "myapp_dev" schema in my database, when I created it using the PGAdmin tool it fixed the issue.



Related Topics



Leave a reply



Submit