如何在PostgreSQL 8.4中安装pgcrypto?
发布时间:2020-12-13 16:23:31 所属栏目:百科 来源:网络整理
导读:我使用的是Ubuntu Server 10.10,我使用apt-get install postgresql安装了PostgreSQL 8.4.我想使用内置的sha1()函数,但似乎我必须首先安装pgcrypto.但我不知道如何安装它. 如果我尝试使用apt-get install pgcrypto安装它并且我没有在我的系统中找到以pgcrypto
我使用的是Ubuntu Server 10.10,我使用apt-get install
postgresql安装了PostgreSQL 8.4.我想使用内置的sha1()函数,但似乎我必须首先安装pgcrypto.但我不知道如何安装它.
如果我尝试使用apt-get install pgcrypto安装它并且我没有在我的系统中找到以pgcrypto开头的任何文件(我尝试查找/ -name“pgcrypto *”),则没有pgcrypto. 如何安装pgcrypto以便在数据库查询中使用摘要(‘word-to-hash’,’sha1′)函数? 更新:我正在努力在另一台Ubuntu机器上安装pgcrypto.使用sudo apt-get install postgresql-contrib-8.4安装软件包之后如何将其安装到我当前的PostgreSQL数据库中?
对于较新版本的PG,请查看Dustin Kirkland的答案
这是Postgres的外部模块.你应该通过apt安装postgresql-contrib-8.4(或你的pg版本)包: apt-get install postgresql-contrib-8.4 然后在/usr/share / postgresql文件夹中的某处找到sql install文件,你需要在数据库上运行pgcryto.sql. psql -d <database> -f /usr/share/postgresql/8.4/contrib/pgcrypto.sql 要么, $cd /usr/share/postgresql/8.4/contrib $psql -d <database> psql (8.4.8) Type "help" for help. database=# i pgcrypto.sql (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |