Extension Files The file format must be extension_name. control, which tells the basics about extension to PostgreSQL, and must be placed in the installation's SHAREDIR/extension directory.
Click the Definition tab to continue. Use the Definition tab to select the Schema and Version: Use the drop-down listbox next to Schema to select the name of the schema in which to install the extension's objects. Use the drop-down listbox next to Version to select the version of the extension to install.
Extensions were implemented in PostgreSQL 9.1 to allow for easier packaging of additions to PostgreSQL. Extensions can package user-visible functions or use hooks in the PostgreSQL to modify how the database does certain processes.
To install PostgreSQL contrib
modules on Ubuntu or Kubuntu (or similar Linux distributions):
sudo apt-get install postgresql-contrib
postgres
).CREATE EXTENSION "uuid-ossp";
If you are trying to install non-"trusted" modules, you need to be a superuser to install them. Otherwise, you only need to have CREATE privilege on the database you are trying to use the module on.
For versions before 9.1, do step #1 above, and then:
Restart the database:
sudo /etc/init.d/postgresql-8.4 restart
Change to the database owner account (e.g., postgres
).
Change to the contrib modules' directory:
/usr/share/postgresql/8.4/contrib/
Use ls
to see a list of the following modules:
adminpack autoinc
btree_gin btree_gist
chkpass citext
cube dblink
dict_int dict_xsyn
earthdistance fuzzystrmatch
hstore insert_username
int_aggregate isn
lo ltree
moddatetime pageinspect
pg_buffercache pgcrypto
pg_freespacemap pgrowlocks
pg_stat_statements pgstattuple
pg_trgm pgxml
refint seg
sslinfo tablefunc
test_parser timetravel
tsearch2 uuid-ossp
Load the SQL files using:
psql -U user_name -d database_name -f module_name.sql
For example, if your administrative user was named postgres
and your database was named storage
and the module you wanted was cube
, you would type:
psql -U postgres -d storage -f cube.sql
I have a database named 'book' for example,
psql -U postgres book create extension cube
Repeat for each extension required, then \q to logouy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With