Re: cannot use createlang after removing public schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Lee Harr" <missive(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: cannot use createlang after removing public schema
Date: 2004-02-19 04:43:00
Message-ID: 28799.1077165780@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Lee Harr" <missive(at)hotmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kris Jurka 2004-02-19 05:35:33 Re: Grant / Revoke functionality
Previous Message Tom Lane 2004-02-19 04:33:01 Re: wishlist: dynamic log volume control