0

PostgreSQL 9.5.4

In changing around the names on my schemas in the database, PostgreSQL added the schema name to each of the tables in the schema.

That is, companies became public.companies. Now in setting the default path, with

ALTER DATABASE chaos SET search_path TO public; 

select * from companies fails. However, select * from public.companies works.

What can be done to either remove the unwanted schema name from its tables, and/or establish a search_path that respects the simple

select * from companies 

TIA

Edit: The opening database definition does a "set search_path to public". However, when doing a "show search_path" in a PgAdmin III query session, "nova" is returned with "show search_path" -- is the problem with PgAdmin ?

7
  • 1
    SET search_path TO public; Commented Dec 14, 2016 at 5:25
  • 2
    What does show search_path; return? If it's set for the user you're connected as it will override the database default. Commented Dec 14, 2016 at 5:34
  • @teppic "show search_path" shows "nova" --the name prior to renaming the schema's. "Alter database chaos set search_path to public" seems not to be respected?? Commented Dec 14, 2016 at 5:38
  • @SergeyGornostaev "Set search_path to public:" worked -- but is it permanent? Commented Dec 14, 2016 at 5:44
  • 1
    Use alter role <myuser> set search_path to public; to make it permanent. Commented Dec 14, 2016 at 5:50

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.