Skip to content

pgqr

QR Code generator from PostgreSQL

pgqr · QR Code generator from PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4260pgqrpgqr1.0UTILBSD-3-ClauseC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.019 18 17 16 15pgqr-
RPMPIGSTY1.019 18 17 16 15pgqr_$v-
DEBPIGSTY1.019 18 17 16 15postgresql-$v-pgqr-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el8.aarch64N/APIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el9.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el9.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el10.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
el10.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d12.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d12.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d13.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
d13.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u22.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u22.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u24.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u24.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u26.x86_64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0
u26.aarch64PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0PIGSTY 1.0

Source

pig build pkg pgqr;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install pgqr;		# install by package name

pig install pgqr -v 19;   # install for PG 19
pig install pgqr -v 18;   # install for PG 18
pig install pgqr -v 17;   # install for PG 17
pig install pgqr -v 16;   # install for PG 16
pig install pgqr -v 15;   # install for PG 15

Create this extension with:

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.

Table reader