Create Extension search path

Поиск
Список
Период
Сортировка
Искать

Create Extension search path

От:
Roger Niederland <roger@niederland.com>
Дата:
On my windows install of postgres 9.1.0.

I have a search_path set in the config file.  This search path has several schemas defined.
Some of the databases within postgres, do not have the schema specified on the search path defined within the database.

Trying to add pgcryto via:
CREATE EXTENSION pgcrypto;
or
CREATE EXTENSION pgcrypto SCHEMA public;
Fail with the error invalid value for parameter "search_path".

To add the extension required me to change the search_path.
Is it required that all any schema added to the search_path exist in all databases?

Thanks,
Roger


Re: Create Extension search path

От:
Richard Huxton <dev@archonet.com>
Дата:
On 28/09/11 18:51, Roger Niederland wrote:
> To add the extension required me to change the search_path.
> Is it required that all any schema added to the search_path exist in all
> databases?

If set in the configuration file, yes (unless you want errors).

You can set it per-database or per-user though. See ALTER DATABASE or 
ALTER ROLE.

-- 
   Richard Huxton
   Archonet Ltd

Re: Create Extension search path

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Roger Niederland  writes:
> On my windows install of postgres 9.1.0.
> I have a search_path set in the config file.  This search path has 
> several schemas defined.
> Some of the databases within postgres, do not have the schema specified 
> on the search path defined within the database.

> Trying to add pgcryto via:
> CREATE EXTENSION pgcrypto;
> or
> CREATE EXTENSION pgcrypto SCHEMA public;
> Fail with the error invalid value for parameter "search_path".

> To add the extension required me to change the search_path.

I've committed a fix for this.  Thanks for the report!

(As pointed out in the thread, there are probably better ways to do what
you're doing with the search path, but in any case it's not real
desirable for CREATE EXTENSION to fail if the current setting is wonky.)

			regards, tom lane
FAQ