pgqr

QR Code generator from PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
pgqr1.0UTILBSD 3-ClauseC
IDExtensionBinLibLoadCreateTrustRelocSchema
4250pgqrNoYesNoYesNoYes-
Relatedpg_protobuf base36 base62 gzip bzip zstd http pg_net

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.01817161514pgqr-
RPMPIGSTY1.01817161514pgqr_$v-
DEBPIGSTY1.01817161514postgresql-$v-pgqr-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u22.x86_64
u22.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u24.x86_64
u24.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0

Build

You can build the RPM / DEB packages for pgqr using pig build:

pig build pkg pgqr         # build RPM / DEB packages

Install

You can install pgqr directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pgqr;          # Install for current active PG version
pig ext install -y pgqr -v 18  # PG 18
pig ext install -y pgqr -v 17  # PG 17
pig ext install -y pgqr -v 16  # PG 16
pig ext install -y pgqr -v 15  # PG 15
pig ext install -y pgqr -v 14  # PG 14
dnf install -y pgqr_18       # PG 18
dnf install -y pgqr_17       # PG 17
dnf install -y pgqr_16       # PG 16
dnf install -y pgqr_15       # PG 15
dnf install -y pgqr_14       # PG 14
apt install -y postgresql-18-pgqr   # PG 18
apt install -y postgresql-17-pgqr   # PG 17
apt install -y postgresql-16-pgqr   # PG 16
apt install -y postgresql-15-pgqr   # PG 15
apt install -y postgresql-14-pgqr   # PG 14

Create Extension:

CREATE EXTENSION pgqr;

Usage

pgqr: QR code generation for PostgreSQL

Function

pgqr(t text, correction_level integer, model_number integer, scale integer) RETURNS bytea

Parameters:

  • t – text to encode into the QR code
  • correction_level – error correction level: 0 to 3
  • model_number – QR model number: 0 to 2
  • scale – pixels per dot (scaling factor)

Example

Generate a QR code as a monochrome bitmap:

SELECT pgqr('QR Code with PostgreSQL', 0, 0, 4);

The output is a monochrome bitmap image (BMP format) returned as bytea, ready for display or storage.


Last Modified 2026-03-12: add pg extension catalog (95749bf)