pgqr
QR Code generator from PostgreSQL
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgqr | 1.0 | UTIL | BSD 3-Clause | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4250 | pgqr | No | Yes | No | Yes | No | Yes | - |
| Related | pg_protobuf base36 base62 gzip bzip zstd http pg_net |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | pgqr | - |
| RPM | PIGSTY | 1.0 | 1817161514 | pgqr_$v | - |
| DEB | PIGSTY | 1.0 | 1817161514 | postgresql-$v-pgqr | - |
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
Function
pgqr(t text, correction_level integer, model_number integer, scale integer) RETURNS bytea
Parameters:
t– text to encode into the QR codecorrection_level– error correction level: 0 to 3model_number– QR model number: 0 to 2scale– 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.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.