"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