BUG #16698: Create extension and search path

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: miha(dot)vrhovnik(at)gmail(dot)com
Subject: BUG #16698: Create extension and search path
Date: 2020-11-03 07:57:33
Message-ID: 16698-89213113705fc24a@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16698
Logged by: Miha Vrhovnik
Email address: miha(dot)vrhovnik(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-11-03 10:19:26 BUG #16699: PostgreSQL failed to run "timetz" test on release and debug configuration with MSVC on windows
Previous Message PG Bug reporting form 2020-11-03 01:55:54 BUG #16697: timetz regression test seems to have a false failure