Aggiungere un'estensione in PostgreSQL
ro:Adăugarea unei extensii în PostgreSQL
ru:Добавление расширения в PostgreSQL
pl:Dodawanie rozszerzeń w PostgreSQL
ja:PostgreSQLでの拡張機能の追加
zh:在PostgreSQL中添加一个扩展
de:Hinzufügen einer Erweiterung in PostgreSQL
nl:Een extensie toevoegen in PostgreSQL
fr:Ajouter une extension en PostgreSQL
Il presente articolo è stato tradotto tramite un software di traduzione automatica. È possibile visualizzare l'origine articolo qui.
pt:Acrescentar uma extensão no PostgreSQL
es:Añadir una extensión en PostgreSQL
en:Adding an extension in PostgreSQL
Introduzione
Questa pagina si occupa di aggiungere un'estensione a un database PostgreSQL.
Connessione a PostgreSQL
Andiamo sotto l'utente postgres poi ci colleghiamo al database PostgreSQL test:
# su - postgres
postgres@vm-postgres:~$ psql -d test
psql (9.1.24lts2)
Saisissez « help » pour l aide.
test=#
Controlliamo le estensioni attualmente presenti:
test=# \dx
Liste des extensions installées
Nom | Version | Schéma | Description
-----------+---------+------------+-------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 ligne)
Aggiungere un'estensione
Aggiungeremo, per esempio, l'estensione unaccent (funzione che permette, tra le altre cose, di rimuovere gli accenti):
test=# CREATE EXTENSION IF NOT EXISTS "unaccent";
CREATE EXTENSION
Controlliamo che sia a posto:
test=# \dx
Liste des extensions installées
Nom | Version | Schéma | Description
-----------+---------+------------+-------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
unaccent | 1.0 | public | text search dictionary that removes accents
(2 lignes)
Possiamo anche controllare che sia funzionale, esempio:
test=# SELECT unaccent('Hôtel');
unaccent
----------
Hotel
(1 ligne)
Possiamo che la parola Hotel è restituita senza accento circonflesso.
Cet article vous a semblé utile ?
Attivare l'aggiornamento automatico dei commenti