Re: cannot use createlang after removing public schema - Mailing list pgsql-general

From Tom Lane
Subject Re: cannot use createlang after removing public schema
Date
Msg-id 28799.1077165780@sss.pgh.pa.us
Whole thread Raw
In response to cannot use createlang after removing public schema  ("Lee Harr" <missive@hotmail.com>)
List pgsql-general
"Lee Harr" <missive@hotmail.com> writes:
>> createdb foo
> CREATE DATABASE
>> psql foo -c "drop schema public"
> DROP SCHEMA
>> createlang plpgsql foo
> createlang: language installation failed: ERROR:  no schema has been
> selected to create in

This is not different from the error you'd get if you tried to create
any other sort of object at this point.  You have no public schema, and
you have no per-user schema matching your user name, so there's simply
not anyplace to create anything, because there are no schemas in your
search path.

You need to make a schema in which you would like the plpgsql language
handler to live (no, I don't really recommend putting it in pg_catalog).
Then use ALTER DATABASE SET or ALTER USER SET to make your default
search_path begin with that schema.  Then createlang will work, as will
"CREATE TABLE foo" and other creation commands.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: wishlist: dynamic log volume control
Next
From: Kris Jurka
Date:
Subject: Re: Grant / Revoke functionality