pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: miha.vrhovnik@gmail.com
Subject: BUG #16698: Create extension and search path
Date: Tue, 03 Nov 2020 07:57:33 +0000
Message-ID: <16698-89213113705fc24a@postgresql.org> (raw)

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



view thread (8+ messages)  latest in thread

Message-ID: <16698-89213113705fc24a@postgresql.org>
Permalink:  ../16698-89213113705fc24a@postgresql.org/
Also on:    postgresql.org/message-id/16698-89213113705fc24a@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, miha.vrhovnik@gmail.com
  Subject: Re: BUG #16698: Create extension and search path
  In-Reply-To: <16698-89213113705fc24a@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox