Difference between revisions of "Adding an extension in PostgreSQL"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
Line 1: Line 1:
 +
<span data-link_translate_pl_title="Dodawanie rozszerzeń w PostgreSQL"  data-link_translate_pl_url="Dodawanie rozszerzeń w PostgreSQL"></span>[[:pl:Dodawanie rozszerzeń w PostgreSQL]][[pl:Dodawanie rozszerzeń w PostgreSQL]]
 
<span data-link_translate_ja_title="PostgreSQLでの拡張機能の追加"  data-link_translate_ja_url="PostgreSQLでの拡張機能の追加"></span>[[:ja:PostgreSQLでの拡張機能の追加]][[ja:PostgreSQLでの拡張機能の追加]]
 
<span data-link_translate_ja_title="PostgreSQLでの拡張機能の追加"  data-link_translate_ja_url="PostgreSQLでの拡張機能の追加"></span>[[:ja:PostgreSQLでの拡張機能の追加]][[ja:PostgreSQLでの拡張機能の追加]]
 
<span data-link_translate_zh_title="在PostgreSQL中添加一个扩展"  data-link_translate_zh_url="在PostgreSQL中添加一个扩展"></span>[[:zh:在PostgreSQL中添加一个扩展]][[zh:在PostgreSQL中添加一个扩展]]
 
<span data-link_translate_zh_title="在PostgreSQL中添加一个扩展"  data-link_translate_zh_url="在PostgreSQL中添加一个扩展"></span>[[:zh:在PostgreSQL中添加一个扩展]][[zh:在PostgreSQL中添加一个扩展]]

Revision as of 10:19, 8 July 2021

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 es:Añadir una extensión en PostgreSQL fr:Ajouter une extension en PostgreSQL
This article has been created by an automatic translation software. You can view the article source here.

Introduction

This page deals with adding an extension to a PostgreSQL database.

Connecting to PostgreSQL

We switch to the postgres user and then connect to the PostgreSQL database test:

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

test=#

We check the extensions currently present:

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

Adding an extension

We will, for example, add the extension unaccent (a function that allows, among other things, to remove accents):

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

We check that it is in place:

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)

We can also check that it is functional, for example:

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

The word Hotel is returned without a circumflex accent.




Cet article vous a semblé utile ?

0



You are not allowed to post comments.