From 875b412331ee4aeac6c06382d7cd00f3f99018d1 Mon Sep 17 00:00:00 2001 From: abenmiloud Date: Tue, 30 Jun 2020 09:28:04 +0200 Subject: [PATCH] =?UTF-8?q?Proc=C3=A9dure=20pour=20activer=20module=20`pgc?= =?UTF-8?q?rypto`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoPostgreSQL.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/HowtoPostgreSQL.md b/HowtoPostgreSQL.md index 5a4c9b9f..e7805a99 100644 --- a/HowtoPostgreSQL.md +++ b/HowtoPostgreSQL.md @@ -1295,3 +1295,27 @@ RemainAfterExit=on [Install] WantedBy=multi-user.target ~~~ + +### Activer module `pgcrypto` + +Dans le *shell* `psql` : + +~~~ +hostname=# drop extension pgcrypto; +hostname=# create extension pgcrypto; +~~~ + +Pour vérifier : + +~~~ +hostname=# select pg_get_functiondef(to_regproc('gen_random_uuid')); + pg_get_functiondef +----------------------------------------------------------- + CREATE OR REPLACE FUNCTION public.gen_random_uuid() + + RETURNS uuid + + LANGUAGE c + + PARALLEL SAFE + + AS '$libdir/pgcrypto', $function$pg_random_uuid$function$+ + +(1 row) +~~~ \ No newline at end of file