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

From PG Bug reporting form
Subject BUG #16698: Create extension and search path
Date
Msg-id 16698-89213113705fc24a@postgresql.org
Whole thread Raw
Responses Re: BUG #16698: Create extension and search path
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16698
Logged by:          Miha Vrhovnik
Email address:      miha.vrhovnik@gmail.com
PostgreSQL version: 13.0
Operating system:   Linux
Description:

The documentation states, that I can use search_path to define in which
schema the extension is going to be created, but this is clearly not
true..

postgres=# CREATE DATABASE test;
CREATE DATABASE
postgres=# CREATE SCHEMA foo1;
CREATE SCHEMA
postgres=# SET search_path = 'foo1';
SET
postgres=# CREATE EXTENSION ltree;
CREATE EXTENSION
postgres=# CREATE SCHEMA foo2;
CREATE SCHEMA
postgres=# SET search_path = 'foo2';
SET
postgres=# CREATE EXTENSION ltree;
ERROR:  extension "ltree" already exists
postgres=# SHOW search_path;
 search_path 
-------------
 foo2
(1 row)

It's the same with example from the documentation.(This continues in the
same session, so search_path is set to foo2 at first create extension)

postgres=# CREATE EXTENSION hstore;
CREATE EXTENSION
postgres=# SET search_path = 'foo1';
SET
postgres=# CREATE EXTENSION hstore;
ERROR:  extension "hstore" already exists

It's a shame that this doesn't work as documented as creating migrations or
tests where each test is run in different schema is more difficult.

BR,
Miha


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16697: timetz regression test seems to have a false failure
Next
From: PG Bug reporting form
Date:
Subject: BUG #16699: PostgreSQL failed to run "timetz" test on release and debug configuration with MSVC on windows