DEV Community

Franck Pachot for YugabyteDB

Posted on • Updated on

Install extensions from PGDG repo to YugabyteDB in Alma8

In the previous post, I installed the sequential_uuids on Centos. Here are shorter instructions, updated to run on Alma8.

I start a quick lab for the demo:

docker run -it --rm yugabytedb/yugabyte sleep infinity

cat /etc/system-release

/home/yugabyte/bin/yugabyted start --listen 0.0.0.0
until /home/yugabyte/postgres/bin/pg_isready ; do sleep 1 ; done | uniq

Enter fullscreen mode Exit fullscreen mode

Image description

The packages available for YugabyteDB are in the repo for your OS, architecture and the PostgreSQL version YugabyteDB is compatible with.

The following downloads the extension RPM and installs it:


-- I put the name of the extension in $e and the package name for PostgreSQL 11 will be ${e}_11
e=sequential_uuids

-- the RPM will be downloaded to a temporary directory
cd /var/tmp
-- install the PGDG repo for EL8
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

-- install the extension 
dnf install --downloadonly -y --downloaddir=$PWD --repo pgdg11 ${e}_11
-- extract the files to the extension directory (see previous post)
mkdir -p ./usr ; ln -Ts $YB_HOME/postgres ./usr/pgsql-11 ; rpm2cpio ./${e}_11-*.rpm | cpio -idmv --no-absolute-filenames
-- test the CREATE EXTENSION
ysqlsh -ec "create extension ${e} cascade"

Enter fullscreen mode Exit fullscreen mode

Image description

Image description

Image description

That's all. I recommend doing this in a lab, like the docker container here, to see if any dependency is missing or if there are any incompatibility with YugabyteDB.

If you have a multi-node cluster, you should install the same $YB_HOME/postgres in all nodes.

I have tested this procedure with the following extensions:

  • sequential_uuids that generates Sequential UUID
  • TopN that returns the top values in a database according to some criteria.
  • timestamp9 a nanosecond precision timestamp
  • tdigest a data structure for on-line accumulation of rank-based statistics such as quantiles and trimmed means

Top comments (0)