- PostgreSQL for Data Architects
- Jayadevan Maymala
- 304字
- 2021-07-23 19:41:24
Working with extensions
We have so far initialized the database cluster. However, we made quite a few extensions available using the world
option. What about them? We can list the installed extensions using the dx
(describe extension) command at the psql
prompt:
postgres=# \dx List of installed extensions Name | Version | Schema | Description ---------+---------+------------+------------------------------ plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (1 row)
To get a list of available extensions, we can query the pg_available_extensions
view, as shown here:
postgres=# SELECT name,comment FROM pg_available_extensions limit 5; name | comment ----------+-------------------------------------------------------------- dblink | connect to other PostgreSQL databases from within a database isn | data types for international product numbering standards file_fdw | foreign-data wrapper for flat file access tsearch2 | compatibility package for pre-8.3 text search functions unaccent | text search dictionary that removes accents (5 rows)
Let's try installing one extension and then see the list of installed extensions again:
postgres=# CREATE EXTENSION dblink ; CREATE EXTENSION postgres=# \dx List of installed extensions Name | Version | Schema | Description ---------+---------+------------+-------------------------------------------------------------- dblink | 1.1 | public | connect to other PostgreSQL databases from within a database plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (2 rows)
The dblink
extension has been added to the list of installed extensions. To remove it, just drop it:
postgres=# DROP EXTENSION dblink ; DROP EXTENSION postgres=# \dx List of installed extensions Name | Version | Schema | Description ---------+---------+------------+------------------------------ plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (1 row)
Tip
Downloading the example code
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
- Practical Internet of Things Security
- Python編程完全入門教程
- Scratch 3游戲與人工智能編程完全自學(xué)教程
- Hands-On C++ Game Animation Programming
- 用戶體驗(yàn)增長:數(shù)字化·智能化·綠色化
- Statistical Application Development with R and Python(Second Edition)
- 基于SpringBoot實(shí)現(xiàn):Java分布式中間件開發(fā)入門與實(shí)戰(zhàn)
- Building Serverless Web Applications
- 分布式數(shù)據(jù)庫原理、架構(gòu)與實(shí)踐
- jQuery從入門到精通(微課精編版)
- ROS機(jī)器人編程實(shí)戰(zhàn)
- 美麗洞察力:從化妝品行業(yè)看顧客需求洞察
- Puppet Cookbook(Third Edition)
- Python深度學(xué)習(xí)入門:從零構(gòu)建CNN和RNN
- Computer Vision with Python 3