pgproto
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgproto | 0.5.0 | UTIL | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4130 | pgproto | No | Yes | No | Yes | No | Yes | - |
| Related | pg_protobuf decoderbufs wal2json pgoutput test_decoding pgmqtt kafka_fdw pgq pg_logicalinspect |
|---|
SQL 1.0.
Version
| OS / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.5.0 el8.x86_64.pg18 : pgproto_18 pgproto_18-0.5.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.5.0 el8.x86_64.pg17 : pgproto_17 pgproto_17-0.5.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.5.0 el8.x86_64.pg16 : pgproto_16 pgproto_16-0.5.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.5.0 el8.x86_64.pg15 : pgproto_15 pgproto_15-0.5.0-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | N/A | PIGSTY 0.5.0 el8.aarch64.pg18 : pgproto_18 pgproto_18-0.5.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.5.0 el8.aarch64.pg17 : pgproto_17 pgproto_17-0.5.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.5.0 el8.aarch64.pg16 : pgproto_16 pgproto_16-0.5.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.5.0 el8.aarch64.pg15 : pgproto_15 pgproto_15-0.5.0-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 0.5.0 el9.x86_64.pg19 : pgproto_19 pgproto_19-0.5.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.5.0 el9.x86_64.pg18 : pgproto_18 pgproto_18-0.5.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.5.0 el9.x86_64.pg17 : pgproto_17 pgproto_17-0.5.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.5.0 el9.x86_64.pg16 : pgproto_16 pgproto_16-0.5.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.5.0 el9.x86_64.pg15 : pgproto_15 pgproto_15-0.5.0-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 0.5.0 el9.aarch64.pg19 : pgproto_19 pgproto_19-0.5.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.5.0 el9.aarch64.pg18 : pgproto_18 pgproto_18-0.5.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.5.0 el9.aarch64.pg17 : pgproto_17 pgproto_17-0.5.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.5.0 el9.aarch64.pg16 : pgproto_16 pgproto_16-0.5.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.5.0 el9.aarch64.pg15 : pgproto_15 pgproto_15-0.5.0-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 0.5.0 el10.x86_64.pg19 : pgproto_19 pgproto_19-0.5.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.5.0 el10.x86_64.pg18 : pgproto_18 pgproto_18-0.5.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.5.0 el10.x86_64.pg17 : pgproto_17 pgproto_17-0.5.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.5.0 el10.x86_64.pg16 : pgproto_16 pgproto_16-0.5.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.5.0 el10.x86_64.pg15 : pgproto_15 pgproto_15-0.5.0-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 0.5.0 el10.aarch64.pg19 : pgproto_19 pgproto_19-0.5.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.5.0 el10.aarch64.pg18 : pgproto_18 pgproto_18-0.5.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.5.0 el10.aarch64.pg17 : pgproto_17 pgproto_17-0.5.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.5.0 el10.aarch64.pg16 : pgproto_16 pgproto_16-0.5.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.5.0 el10.aarch64.pg15 : pgproto_15 pgproto_15-0.5.0-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 0.5.0 d12.x86_64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.5.0 d12.x86_64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.5.0 d12.x86_64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.5.0 d12.x86_64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.5.0 d12.x86_64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 0.5.0 d12.aarch64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.5.0 d12.aarch64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.5.0 d12.aarch64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.5.0 d12.aarch64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.5.0 d12.aarch64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 0.5.0 d13.x86_64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.5.0 d13.x86_64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.5.0 d13.x86_64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.5.0 d13.x86_64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.5.0 d13.x86_64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 0.5.0 d13.aarch64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.5.0 d13.aarch64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.5.0 d13.aarch64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.5.0 d13.aarch64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.5.0 d13.aarch64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 0.5.0 u22.x86_64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.5.0 u22.x86_64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.5.0 u22.x86_64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.5.0 u22.x86_64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.5.0 u22.x86_64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 0.5.0 u22.aarch64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.5.0 u22.aarch64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.5.0 u22.aarch64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.5.0 u22.aarch64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.5.0 u22.aarch64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 0.5.0 u24.x86_64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.5.0 u24.x86_64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.5.0 u24.x86_64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.5.0 u24.x86_64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.5.0 u24.x86_64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 0.5.0 u24.aarch64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.5.0 u24.aarch64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.5.0 u24.aarch64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.5.0 u24.aarch64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.5.0 u24.aarch64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 0.5.0 u26.x86_64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.5.0 u26.x86_64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.5.0 u26.x86_64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.5.0 u26.x86_64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.5.0 u26.x86_64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 0.5.0 u26.aarch64.pg19 : postgresql-19-pgproto postgresql-19-pgproto_0.5.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.5.0 u26.aarch64.pg18 : postgresql-18-pgproto postgresql-18-pgproto_0.5.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.5.0 u26.aarch64.pg17 : postgresql-17-pgproto postgresql-17-pgproto_0.5.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.5.0 u26.aarch64.pg16 : postgresql-16-pgproto postgresql-16-pgproto_0.5.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.5.0 u26.aarch64.pg15 : postgresql-15-pgproto postgresql-15-pgproto_0.5.0-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for pgproto using pig build:
Install
You can install pgproto 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: README, release 0.5.0, PGXN 0.5.0, SQL definitions, Makefile, pgproto.control
pgproto stores Protocol Buffers proto3 payloads in PostgreSQL as a native protobuf type, with schema-aware extraction, update helpers, containment/index support, and text/integer path operators. The upstream package version is 0.5.0; the extension SQL/control default version remains 1.0.
The current upstream source is a C/PGXS extension: the official Makefile sets MODULE_big = pgproto, builds C objects from src/*.o, and includes $(PGXS). The README describes the implementation as pure C with no external Protobuf library dependency.
Schema Registry and Storage
pgproto needs runtime protobuf descriptors before name/path-based extraction can interpret a binary payload. Register a serialized FileDescriptorSet in pb_schemas, or call the SQL registration helper when that fits your workflow:
Store serialized protobuf bytes in a protobuf column:
The 0.5.0 SQL also installs a convenience cast from protobuf to bytea, so byte-oriented functions such as length(data::bytea) can be used when needed.
Querying
Use the path operators for nested, repeated, and map fields:
Other user-facing extraction helpers and operators defined by the extension include:
pb_get_int32(protobuf, int4)for tag-basedint4extraction.pb_get_int32_by_name(protobuf, text, text)andpb_get_int32_by_name_dot(protobuf, text)for name-based integer extraction.->as shorthand for dot-path integer lookup throughpb_get_int32_by_name_dot.pb_get_int32_by_path(protobuf, text[])behind#>.pb_get_text_by_path(protobuf, text[])behind#>>.pb_to_json(protobuf, text)for text JSON conversion when a message name is supplied.
Updates and Merge
pb_set, pb_insert, and pb_delete are pure functions: they return a new protobuf value, so persist changes with UPDATE ... SET. Upstream 0.5.0 documents automatic compaction for these mutations to remove stale tags.
Merge two protobuf values with the || operator, which calls pb_merge:
Indexing and Containment
Use ordinary expression indexes on extracted fields:
The SQL definitions also expose protobuf containment with @> and a default protobuf_gin_ops operator class for GIN indexes:
Schema Evolution
The README frames schema evolution as a normal use case: added fields read as NULL from older messages, deprecated or unknown fields are skipped during traversal, enums are read as standard varints, and unset oneof fields return NULL.
Caveats
- Runtime schemas are required for schema-aware path navigation; without registered descriptors, the extension cannot resolve message field names.
#>returnsint4and#>>returnstext; choose the operator/function that matches the expected field type.- Mutator helpers do not update rows in place; the returned value must be assigned back to the column.
- The README benchmark numbers are upstream project benchmarks, not independent performance guarantees.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)