×
Community Blog Use PGXN to Install the PostgreSQL | PolarDB Plug-in

Use PGXN to Install the PostgreSQL | PolarDB Plug-in

This article describes how to use PostgreSQL Extension Network (PGXN) to Install the PostgreSQL | PolarDB Plug-in.

By digoal

Background

PostgreSQL Extension Network (PGXN) is an open source plug-in management platform for PostgreSQL. Most plug-ins can be downloaded in PGXN.

It is very convenient to use PGXN to search for plug-ins and install them for databases.

For example, download PGXN in debian:

apt-get install -y pgxnclient  

List PGXN help

root@abaf67f643b7:/tmp/pgvector# pgxn --help  
usage: pgxnclient [--version] [--help] COMMAND ...  
  
Interact with the PostgreSQL Extension Network (PGXN).  
  
optional arguments:  
  --version  print the version number and exit  
  --help     show this help message and exit  
  
available commands:  
  COMMAND    the command to execute. The complete list is available using `pgxn help --all`. Builtin commands are:  
    check    run a distribution's test  
    download  
             download a distribution from the network  
    help     display help and other program information  
    info     print information about a distribution  
    install  download, build and install a distribution  
    load     load a distribution's extensions into a database  
    mirror   return information about the available mirrors  
    search   search in the available extensions  
    uninstall  
             remove a distribution from the system  
    unload   unload a distribution's extensions from a database  

List PGXN mirror

root@abaf67f643b7:/tmp/pgvector# pgxn mirror  
https://pgxn.dalibo.org/  
https://api.pgxn.org/  

List the basic information of a plug-in

root@abaf67f643b7:/tmp/pgvector# pgxn info kmeans  
name: kmeans  
abstract: K-means clustering as a user-defined window function  
description: This module provides k-means calculation over row set.  
maintainer: Hitoshi Harada <umi.tanuki@gmail.com>  
license: postgresql  
release_status: stable  
version: 1.1.0  
date: 2011-07-22T18:11:02Z  
sha1: 6714548002400d038370cfb9bcd0b22df1e8a73c  
provides: kmeans: 1.1.0  
  
root@abaf67f643b7:/tmp/pgvector# pgxn info vector  
name: vector  
abstract: Open-source vector similarity search for Postgres  
description: Supports L2 distance, inner product, and cosine distance  
maintainer: Andrew Kane <andrew@ankane.org>  
license: PostgreSQL: http://www.postgresql.org/about/licence  
release_status: stable  
version: 0.5.0  
date: 2023-08-29T00:08:28Z  
sha1: 44d7f4398b2ccef33c5472ae1adff24cff7c48f2  
provides: vector: 0.5.0  
runtime: requires: PostgreSQL 11.0.0  

Install a plug-in

root@abaf67f643b7:/tmp/pgvector# pgxn install kmeans  
  
root@abaf67f643b7:/tmp/pgvector# pgxn install vector  
0 1 0
Share on

digoal

276 posts | 24 followers

You may also like

Comments