Re: BUG #16698: Create extension and search path - Mailing list pgsql-bugs

From Miha Vrhovnik
Subject Re: BUG #16698: Create extension and search path
Date
Msg-id CAAjGE4roRjCHnn1mOccGB+dsjqJT2JxdOkCuVAh6Teo=91ZXWA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16698: Create extension and search path  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

On Tue, 3 Nov 2020 at 15:36, Tom Lane <tgl@sss.pgh.pa.us> wrote:
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

pgsql-bugs by date:

Previous
From: luis.roberto@siscobra.com.br
Date:
Subject: Re: segfault with incremental sort
Next
From: Tom Lane
Date:
Subject: Re: User with BYPASSRLS privilege can't change password