opencc
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_opencc | 0.1.0 | UTIL | Apache-2.0 AND BSD-2-Clause AND MIT | C++ |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4480 | opencc | No | Yes | No | Yes | Yes | No | opencc |
UTF8; bundled OpenCC 1.4.2.
Version
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.1.0 el8.x86_64.pg18 : pg_opencc_18 pg_opencc_18-0.1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.1.0 el8.x86_64.pg17 : pg_opencc_17 pg_opencc_17-0.1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.1.0 el8.x86_64.pg16 : pg_opencc_16 pg_opencc_16-0.1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.1.0 el8.x86_64.pg15 : pg_opencc_15 pg_opencc_15-0.1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.1.0 el8.x86_64.pg14 : pg_opencc_14 pg_opencc_14-0.1.0-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 0.1.0 el8.aarch64.pg18 : pg_opencc_18 pg_opencc_18-0.1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.1.0 el8.aarch64.pg17 : pg_opencc_17 pg_opencc_17-0.1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.1.0 el8.aarch64.pg16 : pg_opencc_16 pg_opencc_16-0.1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.1.0 el8.aarch64.pg15 : pg_opencc_15 pg_opencc_15-0.1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.1.0 el8.aarch64.pg14 : pg_opencc_14 pg_opencc_14-0.1.0-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 0.1.0 el9.x86_64.pg18 : pg_opencc_18 pg_opencc_18-0.1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.1.0 el9.x86_64.pg17 : pg_opencc_17 pg_opencc_17-0.1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.1.0 el9.x86_64.pg16 : pg_opencc_16 pg_opencc_16-0.1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.1.0 el9.x86_64.pg15 : pg_opencc_15 pg_opencc_15-0.1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.1.0 el9.x86_64.pg14 : pg_opencc_14 pg_opencc_14-0.1.0-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 0.1.0 el9.aarch64.pg18 : pg_opencc_18 pg_opencc_18-0.1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.1.0 el9.aarch64.pg17 : pg_opencc_17 pg_opencc_17-0.1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.1.0 el9.aarch64.pg16 : pg_opencc_16 pg_opencc_16-0.1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.1.0 el9.aarch64.pg15 : pg_opencc_15 pg_opencc_15-0.1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.1.0 el9.aarch64.pg14 : pg_opencc_14 pg_opencc_14-0.1.0-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 0.1.0 el10.x86_64.pg18 : pg_opencc_18 pg_opencc_18-0.1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.1.0 el10.x86_64.pg17 : pg_opencc_17 pg_opencc_17-0.1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.1.0 el10.x86_64.pg16 : pg_opencc_16 pg_opencc_16-0.1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.1.0 el10.x86_64.pg15 : pg_opencc_15 pg_opencc_15-0.1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.1.0 el10.x86_64.pg14 : pg_opencc_14 pg_opencc_14-0.1.0-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 0.1.0 el10.aarch64.pg18 : pg_opencc_18 pg_opencc_18-0.1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.1.0 el10.aarch64.pg17 : pg_opencc_17 pg_opencc_17-0.1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.1.0 el10.aarch64.pg16 : pg_opencc_16 pg_opencc_16-0.1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.1.0 el10.aarch64.pg15 : pg_opencc_15 pg_opencc_15-0.1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.1.0 el10.aarch64.pg14 : pg_opencc_14 pg_opencc_14-0.1.0-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 0.1.0 d12.x86_64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.1.0 d12.x86_64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.1.0 d12.x86_64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.1.0 d12.x86_64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.1.0 d12.x86_64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 0.1.0 d12.aarch64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.1.0 d12.aarch64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.1.0 d12.aarch64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.1.0 d12.aarch64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.1.0 d12.aarch64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 0.1.0 d13.x86_64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.1.0 d13.x86_64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.1.0 d13.x86_64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.1.0 d13.x86_64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.1.0 d13.x86_64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 0.1.0 d13.aarch64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.1.0 d13.aarch64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.1.0 d13.aarch64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.1.0 d13.aarch64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.1.0 d13.aarch64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 0.1.0 u22.x86_64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.1.0 u22.x86_64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.1.0 u22.x86_64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.1.0 u22.x86_64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.1.0 u22.x86_64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 0.1.0 u22.aarch64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.1.0 u22.aarch64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.1.0 u22.aarch64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.1.0 u22.aarch64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.1.0 u22.aarch64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 0.1.0 u24.x86_64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.1.0 u24.x86_64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.1.0 u24.x86_64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.1.0 u24.x86_64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.1.0 u24.x86_64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 0.1.0 u24.aarch64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.1.0 u24.aarch64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.1.0 u24.aarch64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.1.0 u24.aarch64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.1.0 u24.aarch64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 0.1.0 u26.x86_64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.1.0 u26.x86_64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.1.0 u26.x86_64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.1.0 u26.x86_64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.1.0 u26.x86_64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 0.1.0 u26.aarch64.pg18 : postgresql-18-opencc postgresql-18-opencc_0.1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.1.0 u26.aarch64.pg17 : postgresql-17-opencc postgresql-17-opencc_0.1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.1.0 u26.aarch64.pg16 : postgresql-16-opencc postgresql-16-opencc_0.1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.1.0 u26.aarch64.pg15 : postgresql-15-opencc postgresql-15-opencc_0.1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.1.0 u26.aarch64.pg14 : postgresql-14-opencc postgresql-14-opencc_0.1.0-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for pg_opencc using pig build:
Install
You can install pg_opencc directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
opencc, distributed as pg_opencc, converts Simplified Chinese, Traditional Chinese, Taiwan and Hong Kong conventions, and Japanese Shinjitai. Version 0.1.0 embeds OpenCC 1.4.2 and its dictionaries in the shared library; no system OpenCC or external dictionary files are required at runtime.
Enable and convert
Supports PostgreSQL 14–18 and requires a UTF8 database. This trusted extension can be installed by a user with CREATE privilege on the database. Objects use the fixed opencc schema; the extension is not relocatable. Preloading and a server restart are not required.
opencc.convert(input, config) selects a conversion explicitly. Wrappers such as opencc.s2t() and opencc.t2s() provide one function per configuration:
| Configurations | Conversion |
|---|---|
s2t, t2s | Simplified and Traditional Chinese |
s2tw, tw2s, s2hk, hk2s | Taiwan or Hong Kong character conventions |
s2twp, tw2sp | Taiwan regional phrases |
s2hkp, hk2sp | Hong Kong regional phrases; developing |
t2tw, tw2t, t2hk, hk2t | Traditional Chinese variant conversion |
t2jp, jp2t | Japanese old/new character forms; experimental |
Regional conversion and inspection
opencc.localize(input, target, source) accepts zh-Hans, zh-Hant, zh-CN, zh-TW, zh-HK, and ja. Its default source => 'auto' detects the script, but cannot distinguish Taiwan from Hong Kong vocabulary. Supply the source region when regional phrases matter.
| Object | Purpose |
|---|---|
opencc.detect() | Classify the script, including mixed or neutral text |
opencc.script_stats() | Count Han, simplified, traditional, and kana characters |
opencc.configs, opencc.routes | Inspect configurations and regional conversion chains |
opencc.ambiguities(), opencc.candidates() | Inspect ambiguous spans and dictionary candidates |
opencc.explain() | Inspect each conversion stage |
opencc.version() | Report extension, engine, and dictionary digest |
opencc.dependents() | Find dependent database objects and suggested rebuild statements |
Operation and upgrades
Conversion functions are IMMUTABLE STRICT PARALLEL SAFE within an extension version. They can be used in expression indexes and stored generated columns. PostgreSQL 18 generated columns must explicitly use STORED for user-defined conversion functions.
Dictionary changes in a future extension release can change conversion results. Inspect opencc.version() and review the statements returned by opencc.dependents() when upgrading. Dependency discovery does not find calls hidden inside other user-defined functions.
Each backend initializes converters on demand. Optional startup preloading can share their memory across backends; changing shared_preload_libraries requires a restart:
Merge opencc into any existing preload list. opencc.preload also accepts all. Dropping the extension leaves its empty schema behind.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)