public inbox for [email protected]  
help / color / mirror / Atom feed
CREATE EXTENSION not adding extension on second SCHEMA
5+ messages / 5 participants
[nested] [flat]

* CREATE EXTENSION not adding extension on second SCHEMA
@ 2022-05-31 14:20  PG Doc comments form <[email protected]>
  0 siblings, 2 replies; 5+ messages in thread

From: PG Doc comments form @ 2022-05-31 14:20 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/sql-createextension.html
Description:

I'm trying to add an extension to two schemas that I have in my DB.

steps:

1)

CREATE EXTENSION unaccent with SCHEMA public;

response: OK.

2) 

CREATE EXTENSION unaccent with SCHEMA public_test;

response: SQL Error [42710]: ERROR: extension "unaccent" already exists

I tryed:

SET search_path = public_test;
CREATE EXTENSION unaccent;

 and the response is: response: SQL Error [42710]: ERROR: extension
"unaccent" already exists


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: CREATE EXTENSION not adding extension on second SCHEMA
@ 2022-05-31 15:21  jian he <[email protected]>
  parent: PG Doc comments form <[email protected]>
  1 sibling, 0 replies; 5+ messages in thread

From: jian he @ 2022-05-31 15:21 UTC (permalink / raw)
  To: [email protected]; [email protected]

quote from manual:

> CREATE EXTENSION loads a new extension into the current database. There
> must not be an extension of the same name already loaded.
>

You can try to alter[1] the extension to make it located to another schema.

[1]: https://www.postgresql.org/docs/14/sql-alterextension.html


On Tue, May 31, 2022 at 8:39 PM PG Doc comments form <[email protected]>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/sql-createextension.html
> Description:
>
> I'm trying to add an extension to two schemas that I have in my DB.
>
> steps:
>
> 1)
>
> CREATE EXTENSION unaccent with SCHEMA public;
>
> response: OK.
>
> 2)
>
> CREATE EXTENSION unaccent with SCHEMA public_test;
>
> response: SQL Error [42710]: ERROR: extension "unaccent" already exists
>
> I tryed:
>
> SET search_path = public_test;
> CREATE EXTENSION unaccent;
>
>  and the response is: response: SQL Error [42710]: ERROR: extension
> "unaccent" already exists
>


-- 
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: CREATE EXTENSION not adding extension on second SCHEMA
@ 2022-05-31 15:24  David G. Johnston <[email protected]>
  parent: PG Doc comments form <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2022-05-31 15:24 UTC (permalink / raw)
  To: [email protected] <[email protected]>; [email protected] <[email protected]>

On Tuesday, May 31, 2022, PG Doc comments form <[email protected]>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/sql-createextension.html
> Description:
>
> I'm trying to add an extension to two schemas that I have in my DB.
>
> steps:
>
> 1)
>
> CREATE EXTENSION unaccent with SCHEMA public;
>
> response: OK.
>
> 2)
>
> CREATE EXTENSION unaccent with SCHEMA public_test;
>
> response: SQL Error [42710]: ERROR: extension "unaccent" already exists
>
> I tryed:
>
> SET search_path = public_test;
> CREATE EXTENSION unaccent;
>
>  and the response is: response: SQL Error [42710]: ERROR: extension
> "unaccent" already exists
>


It doesn’t work and isn’t documented as something that does work.  I really
don’t see a need to say you cannot install the same extension multiple
times explicitly - the self-describing error seems sufficient.

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: CREATE EXTENSION not adding extension on second SCHEMA
@ 2022-05-31 15:32  Tom Lane <[email protected]>
  parent: David G. Johnston <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2022-05-31 15:32 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: [email protected] <[email protected]>; [email protected] <[email protected]>

"David G. Johnston" <[email protected]> writes:
> On Tuesday, May 31, 2022, PG Doc comments form <[email protected]>
> wrote:
>> I'm trying to add an extension to two schemas that I have in my DB.

> It doesn’t work and isn’t documented as something that does work.  I really
> don’t see a need to say you cannot install the same extension multiple
> times explicitly - the self-describing error seems sufficient.

The CREATE EXTENSION reference page says

"There must not be an extension of the same name already loaded."

and later

"Remember that the extension itself is not considered to be within any
schema: extensions have unqualified names that must be unique
database-wide. But objects belonging to the extension can be within
schemas."

I hardly see how we could make this any plainer.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: CREATE EXTENSION not adding extension on second SCHEMA
@ 2022-05-31 16:58  Gustavo <[email protected]>
  parent: Tom Lane <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Gustavo @ 2022-05-31 16:58 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: David G. Johnston <[email protected]>; [email protected] <[email protected]>

Thank you so much guys, my mistake I didn't pay attention. I'm new
to PostgreSQL and your help is much appreciated!



Em ter., 31 de mai. de 2022 às 12:32, Tom Lane <[email protected]> escreveu:

> "David G. Johnston" <[email protected]> writes:
> > On Tuesday, May 31, 2022, PG Doc comments form <[email protected]>
> > wrote:
> >> I'm trying to add an extension to two schemas that I have in my DB.
>
> > It doesn’t work and isn’t documented as something that does work.  I
> really
> > don’t see a need to say you cannot install the same extension multiple
> > times explicitly - the self-describing error seems sufficient.
>
> The CREATE EXTENSION reference page says
>
> "There must not be an extension of the same name already loaded."
>
> and later
>
> "Remember that the extension itself is not considered to be within any
> schema: extensions have unqualified names that must be unique
> database-wide. But objects belonging to the extension can be within
> schemas."
>
> I hardly see how we could make this any plainer.
>
>                         regards, tom lane
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-05-31 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31 14:20 CREATE EXTENSION not adding extension on second SCHEMA PG Doc comments form <[email protected]>
2022-05-31 15:21 ` jian he <[email protected]>
2022-05-31 15:24 ` David G. Johnston <[email protected]>
2022-05-31 15:32   ` Tom Lane <[email protected]>
2022-05-31 16:58     ` Gustavo <[email protected]>

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