Añadir una extensión en PostgreSQL

De ES Ikoula wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 it:Aggiungere un'estensione in PostgreSQL pt:Acrescentar uma extensão no PostgreSQL fr:Ajouter une extension en PostgreSQL
Este artículo ha sido traducido por un software de traducción automática. Usted puede ver el origen artículo aquí.

en:Adding an extension in PostgreSQL

Introducción

Esta página trata de la adición de una extensión a una base de datos PostgreSQL.

Conexión a PostgreSQL

Vamos con el usuario postgres y nos conectamos a la base de datos PostgreSQL test:

# su - postgres
postgres@vm-postgres:~$ psql -d test
psql (9.1.24lts2)
Saisissez « help » pour l aide.

test=#

Comprobamos las extensiones presentes actualmente:

test=# \dx
                          Liste des extensions installées
    Nom    | Version |   Schéma   |                   Description
-----------+---------+------------+-------------------------------------------------
 plpgsql   | 1.0     | pg_catalog | PL/pgSQL procedural language
(1 ligne)

Añadir una extensión

Por ejemplo, añadiremos la extensión unaccent (función que permite, entre otras cosas, eliminar los acentos):

test=# CREATE EXTENSION IF NOT EXISTS "unaccent";
CREATE EXTENSION

Comprobamos que está en su sitio:

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)

También podemos comprobar que es funcional, por ejemplo:

test=# SELECT unaccent('Hôtel');
 unaccent
----------
 Hotel
(1 ligne)

Podemos que la palabra Hotel se devuelva sin acento circunflejo.




Cet article vous a semblé utile ?

0



No puedes publicar comentarios.