ho installato un'estensione Postgres (unaccent) conCome faccio Postgres estensione a disposizione non superuser
sudo su posgres
psql create extension unaccent
e ora posso usare unacccent in SQL, ma solo se io sono l'utente Postgres.
Come faccio Postgres estensione a disposizione di tutti/un altro utente
(Im su Ubuntu utilizzando Postgres 9.3.5 installato usando apt-install)
jthinksearch=# \dx;
List of installed extensions
Name | Version | Schema | Description
----------+---------+------------+---------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
unaccent | 1.0 | public | text search dictionary that removes accents
(2 rows)
jthinksearch=#
jthinksearch=> \du;
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
ubuntu | | {}
postgres @ ip-172-31- 39-147:/home/ubuntu/code/jthinksearch/reports/src/main/sql $ exit ubuntu @ ip-172-31-39-147: ~/code/jthinksearch/reports/src/main/sql $ psql jthinksearch psql (9.3.5) Digitare "help" per aiuto.
ho dato utente ruolo superuser, ma che non ha ancora aiuto, allora come suggerito mettere il nome dello schema in, che ha avuto un effetto sul messaggio di errore, ma ancora non ha funzionato
jthinksearch=# \du;
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
ubuntu | Superuser | {}
jthinksearch=# select unaccent(name) from musicbrainz.artist where id=195660;
ERROR: function unaccent(character varying) does not exist
LINE 1: select unaccent(name) from musicbrainz.artist where id=19566...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
jthinksearch=# ^C
jthinksearch=# select public.unaccent(name) from musicbrainz.artist where id=195660;
ERROR: text search dictionary "unaccent" does not exist
jthinksearch=#
'grant' accesso alle funzioni dall'interno. Se crei l'estensione nel proprio schema, puoi semplicemente concedere l'accesso a tutto in quello schema –
Come, per favore, ho provato 'CONCEDO TUTTO SU TUTTE LE FUNZIONI IN SCHEMA pubblico TO ubuntu' e non ha avuto effetto –
@a_horse_with_no_name Provato tutto il mio schemi e ancora non funziona –