What are then extensions.. They live in some sort of limbo.. as they don't behave like a natural extension of the database... As they behave differently (because they "require" public shema in path if extensions are created while in public schema ).
If they would then this would work, but it doesn't.. and it requires fully qualified names (OR public schema in set_path) which is annoying.
postgres=# CREATE DATABASE test;
CREATE DATABASE
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# SHOW search_path;
search_path
-----------------
"$user", public
(1 row)
test=# CREATE EXTENSION ltree;
CREATE EXTENSION
test=# CREATE SCHEMA foo1;
CREATE SCHEMA
test=# CREATE SCHEMA foo2;
CREATE SCHEMA
test=# SET search_path = foo1;
SET
test=# CREATE TABLE t(l ltree);
ERROR: type "ltree" does not exist
LINE 1: CREATE TABLE t(l ltree);
BR,
Miha
Miha Vrhovnik <miha.vrhovnik@gmail.com> writes:
> I'm so sorry, but I do not understand... Even if I force the schema in
> CREATE EXTENSION it still says that it already exists. (Tested on 12.4, but
> it's the same with 13, as I have tested it before)
> I'm missing something but the documentation doesn't state that I can only
> install extension once per database.
Extensions are not schema-qualified objects, so no, you cannot have
more than one instance per database.
regards, tom lane