unit
unit
Provides SI unit values, conversions and arithmetic. See the upstream project for its API and release history.
Follow the quick start to set up extension-update email
alerts first, then use the CronJob to install and refresh the catalog. These
examples inherit image references and runtime settings from the catalog. The Cluster YAML
is an excerpt: replace imageCatalogRef: ... with your catalog reference and
keep your existing instance and storage settings.
Usage
1. Add the unit extension image to your Cluster
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-unit
spec:
imageCatalogRef: ...
postgresql:
extensions:
- name: unit
2. Enable the extension in a database
Once the extension's files are available in the cluster, you can install it in a database in either of two ways:
- Declaratively, using a CloudNativePG
Databaseresource. - Through SQL, by running
CREATE EXTENSION unit;in the target database.
Platform teams may make extension containers available across their clusters without installing every extension in every database. Install only the extensions a database uses; letting users enable them through SQL alongside the rest of their DDL schema management code can be a convenient approach.
For extensions that normally require superuser privileges, platform teams can use pgextwlist to allow non-superusers to install an administrator-approved selection of extensions.
3. Verify installation
Connect to the database with psql and run \dx to check the installed extensions.
A SQL check that exercises the installed extension is:
SELECT '1 m'::unit = '100 cm'::unit;
Package, dependencies and maintenance
The image installs PGDG package postgresql-18-unit at the Debian version recorded in metadata.hcl. Package updates are tracked by Renovate; review changes against the package's control file and rerun the target's build. The package is available for PostgreSQL 18 on both Bookworm and Trixie, amd64 and arm64. It depends on the CNPG PostgreSQL 18 base image and libc; no additional runtime package is installed. Its control file requires plpgsql, which PostgreSQL provides in the CNPG base image. The unit module uses GPL-3.0-or-later licensing. Its Debian copyright file is included under /licenses/.
The PGDG installation and upgrade SQL reads unit_prefixes.data and unit_units.data from Debian's /usr/share/postgresql/18/extension directory. CNPG mounts extension-image files under /extensions/unit, so the image build applies the GPL-licensed patch at unit/patches/0001-use-cnpg-mounted-data-files.patch in this repository to point all 14 data-file reads at /extensions/unit/share/extension. The data files and patched SQL scripts are shipped together in the mounted image payload; users do not need to edit the database container.
Overview
Provides SI unit values, conversions and arithmetic. See the upstream project for its API and release history.
Package details
- Extension version
- 7.10
- Image built
- Publisher
- cnpg-extensions
- Build
- Debian
- Platform
- PG 18 · Trixie · amd64
Project links
- Debian source package ↗tracker.debian.org/pkg/postgresql-unit
- Upstream homepage ↗github.com/df7cb/postgresql-unit
Links from package metadata, recipe update rules, or reviewed upstream mappings.
Database setup
- Required extensions
plpgsql(from the PostgreSQL base image)- SQL installation
CREATE EXTENSION unit;- SQL version
7— differs from extension version 7.10
PostgreSQL parameters
None specified
These recipe settings are used in automated smoke tests.
OpenSSF scorecard
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software.
View information about checks. Automated results are informational only; some categories may not apply to this project.
Scanned · Download cached scan ↓
Dangerous-Workflow10
Determines if the project's GitHub Action workflows avoid dangerous patterns.
Reasoning: no dangerous workflow patterns detected
Binary-Artifacts10
Determines if the project has generated executable (binary) artifacts in the source repository.
Reasoning: no binaries found in the repo
Branch-Protection0
Determines if the default and release branches are protected with GitHub's branch protection settings.
Reasoning: branch protection not enabled on development/release branches
- Warn: branch protection not enabled for branch 'master'
Code-Review0
Determines if the project requires human code review before pull requests (aka merge requests) are merged.
Reasoning: Found 2/28 approved changesets -- score normalized to 0
Dependency-Update-Tool0
Determines if the project uses a dependency update tool.
Reasoning: no update tool detected
- Warn: no dependency update tool configurations found
Maintained6
Determines if the project is "actively maintained".
Reasoning: 5 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 6
Token-Permissions0
Determines if the project's workflows follow the principle of least privilege.
Reasoning: detected GitHub workflow tokens with excessive permissions
- Warn: no topLevel permission defined: .github/workflows/regression.yml:1
- Info: no jobLevel write permissions found
Vulnerabilities10
Determines if the project has open, known unfixed vulnerabilities.
Reasoning: 0 existing vulnerabilities detected
Fuzzing0
Determines if the project uses fuzzing.
Reasoning: project is not fuzzed
- Warn: no fuzzer integrations found
Pinned-Dependencies0
Determines if the project has declared and pinned the dependencies of its build process.
Reasoning: dependency not pinned by hash detected -- score normalized to 0
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/regression.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/df7cb/postgresql-unit/regression.yml/master?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
SAST0
Determines if the project uses static code analysis.
Reasoning: SAST tool is not run on all commits -- score normalized to 0
- Warn: 0 commits out of 4 are checked with a SAST tool
Security-Policy0
Determines if the project has published a security policy.
Reasoning: security policy file not detected
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
CI-Tests0
Determines if the project runs tests before pull requests are merged.
Reasoning: 0 out of 2 merged PRs checked by a CI test -- score normalized to 0
CII-Best-Practices0
Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.
Reasoning: no effort to earn an OpenSSF best practices badge detected
Contributors10
Determines if the project has a set of contributors from multiple organizations (e.g., companies).
Reasoning: project has 5 contributing companies or organizations
- Info: found contributions from: Debian, cybertec-postgresql, debian, oftc, powa-team
License0
Determines if the project has defined a license.
Reasoning: license file not detected
- Warn: project does not have a license file
Overview
Provides SI unit values, conversions and arithmetic. See the upstream project for its API and release history.
Package details
- Extension version
- 7.10
- Image built
- Publisher
- cnpg-extensions
- Build
- Debian
- Platform
- PG 18 · Trixie · arm64
Project links
- Debian source package ↗tracker.debian.org/pkg/postgresql-unit
- Upstream homepage ↗github.com/df7cb/postgresql-unit
Links from package metadata, recipe update rules, or reviewed upstream mappings.
Database setup
- Required extensions
plpgsql(from the PostgreSQL base image)- SQL installation
CREATE EXTENSION unit;- SQL version
7— differs from extension version 7.10
PostgreSQL parameters
None specified
These recipe settings are used in automated smoke tests.
OpenSSF scorecard
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software.
View information about checks. Automated results are informational only; some categories may not apply to this project.
Scanned · Download cached scan ↓
Dangerous-Workflow10
Determines if the project's GitHub Action workflows avoid dangerous patterns.
Reasoning: no dangerous workflow patterns detected
Binary-Artifacts10
Determines if the project has generated executable (binary) artifacts in the source repository.
Reasoning: no binaries found in the repo
Branch-Protection0
Determines if the default and release branches are protected with GitHub's branch protection settings.
Reasoning: branch protection not enabled on development/release branches
- Warn: branch protection not enabled for branch 'master'
Code-Review0
Determines if the project requires human code review before pull requests (aka merge requests) are merged.
Reasoning: Found 2/28 approved changesets -- score normalized to 0
Dependency-Update-Tool0
Determines if the project uses a dependency update tool.
Reasoning: no update tool detected
- Warn: no dependency update tool configurations found
Maintained6
Determines if the project is "actively maintained".
Reasoning: 5 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 6
Token-Permissions0
Determines if the project's workflows follow the principle of least privilege.
Reasoning: detected GitHub workflow tokens with excessive permissions
- Warn: no topLevel permission defined: .github/workflows/regression.yml:1
- Info: no jobLevel write permissions found
Vulnerabilities10
Determines if the project has open, known unfixed vulnerabilities.
Reasoning: 0 existing vulnerabilities detected
Fuzzing0
Determines if the project uses fuzzing.
Reasoning: project is not fuzzed
- Warn: no fuzzer integrations found
Pinned-Dependencies0
Determines if the project has declared and pinned the dependencies of its build process.
Reasoning: dependency not pinned by hash detected -- score normalized to 0
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/regression.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/df7cb/postgresql-unit/regression.yml/master?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
SAST0
Determines if the project uses static code analysis.
Reasoning: SAST tool is not run on all commits -- score normalized to 0
- Warn: 0 commits out of 4 are checked with a SAST tool
Security-Policy0
Determines if the project has published a security policy.
Reasoning: security policy file not detected
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
CI-Tests0
Determines if the project runs tests before pull requests are merged.
Reasoning: 0 out of 2 merged PRs checked by a CI test -- score normalized to 0
CII-Best-Practices0
Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.
Reasoning: no effort to earn an OpenSSF best practices badge detected
Contributors10
Determines if the project has a set of contributors from multiple organizations (e.g., companies).
Reasoning: project has 5 contributing companies or organizations
- Info: found contributions from: Debian, cybertec-postgresql, debian, oftc, powa-team
License0
Determines if the project has defined a license.
Reasoning: license file not detected
- Warn: project does not have a license file
Overview
Provides SI unit values, conversions and arithmetic. See the upstream project for its API and release history.
Package details
- Extension version
- 7.10
- Image built
- Publisher
- cnpg-extensions
- Build
- Debian
- Platform
- PG 18 · Bookworm · amd64
Project links
- Debian source package ↗tracker.debian.org/pkg/postgresql-unit
- Upstream homepage ↗github.com/df7cb/postgresql-unit
Links from package metadata, recipe update rules, or reviewed upstream mappings.
Database setup
- Required extensions
plpgsql(from the PostgreSQL base image)- SQL installation
CREATE EXTENSION unit;- SQL version
7— differs from extension version 7.10
PostgreSQL parameters
None specified
These recipe settings are used in automated smoke tests.
OpenSSF scorecard
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software.
View information about checks. Automated results are informational only; some categories may not apply to this project.
Scanned · Download cached scan ↓
Dangerous-Workflow10
Determines if the project's GitHub Action workflows avoid dangerous patterns.
Reasoning: no dangerous workflow patterns detected
Binary-Artifacts10
Determines if the project has generated executable (binary) artifacts in the source repository.
Reasoning: no binaries found in the repo
Branch-Protection0
Determines if the default and release branches are protected with GitHub's branch protection settings.
Reasoning: branch protection not enabled on development/release branches
- Warn: branch protection not enabled for branch 'master'
Code-Review0
Determines if the project requires human code review before pull requests (aka merge requests) are merged.
Reasoning: Found 2/28 approved changesets -- score normalized to 0
Dependency-Update-Tool0
Determines if the project uses a dependency update tool.
Reasoning: no update tool detected
- Warn: no dependency update tool configurations found
Maintained6
Determines if the project is "actively maintained".
Reasoning: 5 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 6
Token-Permissions0
Determines if the project's workflows follow the principle of least privilege.
Reasoning: detected GitHub workflow tokens with excessive permissions
- Warn: no topLevel permission defined: .github/workflows/regression.yml:1
- Info: no jobLevel write permissions found
Vulnerabilities10
Determines if the project has open, known unfixed vulnerabilities.
Reasoning: 0 existing vulnerabilities detected
Fuzzing0
Determines if the project uses fuzzing.
Reasoning: project is not fuzzed
- Warn: no fuzzer integrations found
Pinned-Dependencies0
Determines if the project has declared and pinned the dependencies of its build process.
Reasoning: dependency not pinned by hash detected -- score normalized to 0
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/regression.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/df7cb/postgresql-unit/regression.yml/master?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
SAST0
Determines if the project uses static code analysis.
Reasoning: SAST tool is not run on all commits -- score normalized to 0
- Warn: 0 commits out of 4 are checked with a SAST tool
Security-Policy0
Determines if the project has published a security policy.
Reasoning: security policy file not detected
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
CI-Tests0
Determines if the project runs tests before pull requests are merged.
Reasoning: 0 out of 2 merged PRs checked by a CI test -- score normalized to 0
CII-Best-Practices0
Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.
Reasoning: no effort to earn an OpenSSF best practices badge detected
Contributors10
Determines if the project has a set of contributors from multiple organizations (e.g., companies).
Reasoning: project has 5 contributing companies or organizations
- Info: found contributions from: Debian, cybertec-postgresql, debian, oftc, powa-team
License0
Determines if the project has defined a license.
Reasoning: license file not detected
- Warn: project does not have a license file
Overview
Provides SI unit values, conversions and arithmetic. See the upstream project for its API and release history.
Package details
- Extension version
- 7.10
- Image built
- Publisher
- cnpg-extensions
- Build
- Debian
- Platform
- PG 18 · Bookworm · arm64
Project links
- Debian source package ↗tracker.debian.org/pkg/postgresql-unit
- Upstream homepage ↗github.com/df7cb/postgresql-unit
Links from package metadata, recipe update rules, or reviewed upstream mappings.
Database setup
- Required extensions
plpgsql(from the PostgreSQL base image)- SQL installation
CREATE EXTENSION unit;- SQL version
7— differs from extension version 7.10
PostgreSQL parameters
None specified
These recipe settings are used in automated smoke tests.
OpenSSF scorecard
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software.
View information about checks. Automated results are informational only; some categories may not apply to this project.
Scanned · Download cached scan ↓
Dangerous-Workflow10
Determines if the project's GitHub Action workflows avoid dangerous patterns.
Reasoning: no dangerous workflow patterns detected
Binary-Artifacts10
Determines if the project has generated executable (binary) artifacts in the source repository.
Reasoning: no binaries found in the repo
Branch-Protection0
Determines if the default and release branches are protected with GitHub's branch protection settings.
Reasoning: branch protection not enabled on development/release branches
- Warn: branch protection not enabled for branch 'master'
Code-Review0
Determines if the project requires human code review before pull requests (aka merge requests) are merged.
Reasoning: Found 2/28 approved changesets -- score normalized to 0
Dependency-Update-Tool0
Determines if the project uses a dependency update tool.
Reasoning: no update tool detected
- Warn: no dependency update tool configurations found
Maintained6
Determines if the project is "actively maintained".
Reasoning: 5 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 6
Token-Permissions0
Determines if the project's workflows follow the principle of least privilege.
Reasoning: detected GitHub workflow tokens with excessive permissions
- Warn: no topLevel permission defined: .github/workflows/regression.yml:1
- Info: no jobLevel write permissions found
Vulnerabilities10
Determines if the project has open, known unfixed vulnerabilities.
Reasoning: 0 existing vulnerabilities detected
Fuzzing0
Determines if the project uses fuzzing.
Reasoning: project is not fuzzed
- Warn: no fuzzer integrations found
Pinned-Dependencies0
Determines if the project has declared and pinned the dependencies of its build process.
Reasoning: dependency not pinned by hash detected -- score normalized to 0
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/regression.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/df7cb/postgresql-unit/regression.yml/master?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
SAST0
Determines if the project uses static code analysis.
Reasoning: SAST tool is not run on all commits -- score normalized to 0
- Warn: 0 commits out of 4 are checked with a SAST tool
Security-Policy0
Determines if the project has published a security policy.
Reasoning: security policy file not detected
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
CI-Tests0
Determines if the project runs tests before pull requests are merged.
Reasoning: 0 out of 2 merged PRs checked by a CI test -- score normalized to 0
CII-Best-Practices0
Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.
Reasoning: no effort to earn an OpenSSF best practices badge detected
Contributors10
Determines if the project has a set of contributors from multiple organizations (e.g., companies).
Reasoning: project has 5 contributing companies or organizations
- Info: found contributions from: Debian, cybertec-postgresql, debian, oftc, powa-team
License0
Determines if the project has defined a license.
Reasoning: license file not detected
- Warn: project does not have a license file
Dependencies
Packages shipped in this image, including the extension itself.
1 packages · Scanned
| Package / installed version | License evidence | Advisories |
|---|---|---|
postgresql-18-unit ↗ 7.10-2.pgdg13+2 | GPL-3.0-only AND GPL-3.0-or-later | No ↗ |
No packages match these filters. Try a different name or license, or clear the filters.
Dependencies
Packages shipped in this image, including the extension itself.
1 packages · Scanned
| Package / installed version | License evidence | Advisories |
|---|---|---|
postgresql-18-unit ↗ 7.10-2.pgdg13+2 | GPL-3.0-only AND GPL-3.0-or-later | No ↗ |
No packages match these filters. Try a different name or license, or clear the filters.
Dependencies
Packages shipped in this image, including the extension itself.
1 packages · Scanned
| Package / installed version | License evidence | Advisories |
|---|---|---|
postgresql-18-unit ↗ 7.10-2.pgdg12+2 | GPL-3.0-only AND GPL-3.0-or-later | No ↗ |
No packages match these filters. Try a different name or license, or clear the filters.
Dependencies
Packages shipped in this image, including the extension itself.
1 packages · Scanned
| Package / installed version | License evidence | Advisories |
|---|---|---|
postgresql-18-unit ↗ 7.10-2.pgdg12+2 | GPL-3.0-only AND GPL-3.0-or-later | No ↗ |
No packages match these filters. Try a different name or license, or clear the filters.
Licenses
Original license files shipped in the selected container image.
1 file read directly from /licenses.
/licenses/postgresql-18-unit/copyrightRead notice
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright: (C) 2016-2018 Christoph Berg
License: GPL-3+
Files: definitions.units*
Copyright: (C) 1996-2002, 2004-2017
Free Software Foundation, Inc
License: GPL-3+
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
The full text of the GPL 3 is distributed as in
/usr/share/common-licenses/GPL-3 on Debian systems.
SHA256: 7e7142173a5f4dd211f28ba9de26842127498faa6e6ad32faa441272f38674e0
Licenses
Original license files shipped in the selected container image.
1 file read directly from /licenses.
/licenses/postgresql-18-unit/copyrightRead notice
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright: (C) 2016-2018 Christoph Berg
License: GPL-3+
Files: definitions.units*
Copyright: (C) 1996-2002, 2004-2017
Free Software Foundation, Inc
License: GPL-3+
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
The full text of the GPL 3 is distributed as in
/usr/share/common-licenses/GPL-3 on Debian systems.
SHA256: 7e7142173a5f4dd211f28ba9de26842127498faa6e6ad32faa441272f38674e0
Licenses
Original license files shipped in the selected container image.
1 file read directly from /licenses.
/licenses/postgresql-18-unit/copyrightRead notice
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright: (C) 2016-2018 Christoph Berg
License: GPL-3+
Files: definitions.units*
Copyright: (C) 1996-2002, 2004-2017
Free Software Foundation, Inc
License: GPL-3+
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
The full text of the GPL 3 is distributed as in
/usr/share/common-licenses/GPL-3 on Debian systems.
SHA256: 7e7142173a5f4dd211f28ba9de26842127498faa6e6ad32faa441272f38674e0
Licenses
Original license files shipped in the selected container image.
1 file read directly from /licenses.
/licenses/postgresql-18-unit/copyrightRead notice
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright: (C) 2016-2018 Christoph Berg
License: GPL-3+
Files: definitions.units*
Copyright: (C) 1996-2002, 2004-2017
Free Software Foundation, Inc
License: GPL-3+
License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
The full text of the GPL 3 is distributed as in
/usr/share/common-licenses/GPL-3 on Debian systems.
SHA256: 7e7142173a5f4dd211f28ba9de26842127498faa6e6ad32faa441272f38674e0
Versions
Extension versions and the images built from them.
Tagged GHCR builds fetched .
