pg_protobuf
Protobuf support for PostgreSQL
pg_protobuf : Protobuf support for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4120 | pg_protobuf | pg_protobuf | 1.0 |
UTIL | MIT | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pgproto decoderbufs wal2json pgoutput test_decoding pgmqtt kafka_fdw pgq pg_logicalinspect |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 |
18 17 16 15 14 | pg_protobuf |
- |
| RPM | PIGSTY | 1.0 |
18 17 16 15 14 | pg_protobuf_$v |
- |
| DEB | PIGSTY | 1.0 |
18 17 16 15 14 | postgresql-$v-pg-protobuf |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el8.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el9.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el9.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el10.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el10.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d12.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d12.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d13.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d13.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u22.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u22.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u24.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u24.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u26.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u26.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
Source
github.com/afiskon/pg_protobuf
pg_protobuf-1.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Provides functions to decode Protocol Buffer binary data directly in SQL without schema definitions.
Functions
protobuf_decode(bytea) RETURNS cstring– Decode protobuf binary into a human-readable formatprotobuf_get_int(bytea, int) RETURNS bigint– Extract an integer field by field numberprotobuf_get_string(bytea, int) RETURNS text– Extract a string field by field numberprotobuf_get_bytes(bytea, int) RETURNS bytea– Extract raw bytes by field numberprotobuf_get_bool(bytea, int) RETURNS boolean– Extract a boolean field by field numberprotobuf_get_float(bytea, int) RETURNS real– Extract a float field by field numberprotobuf_get_double(bytea, int) RETURNS double precision– Extract a double field by field numberprotobuf_get_sfixed32(bytea, int) RETURNS int– Extract a signed fixed 32-bit fieldprotobuf_get_sfixed64(bytea, int) RETURNS bigint– Extract a signed fixed 64-bit fieldprotobuf_get_int_multi(bytea, int) RETURNS bigint[]– Extract repeated integer fieldsprotobuf_get_string_multi(bytea, int) RETURNS text[]– Extract repeated string fieldsprotobuf_get_bytes_multi(bytea, int) RETURNS bytea[]– Extract repeated bytes fieldsprotobuf_get_bool_multi(bytea, int) RETURNS boolean[]– Extract repeated boolean fieldsprotobuf_get_float_multi(bytea, int) RETURNS real[]– Extract repeated float fieldsprotobuf_get_double_multi(bytea, int) RETURNS double precision[]– Extract repeated double fieldsprotobuf_get_sfixed32_multi(bytea, int) RETURNS int[]– Extract repeated sfixed32 fieldsprotobuf_get_sfixed64_multi(bytea, int) RETURNS bigint[]– Extract repeated sfixed64 fields
Example
Limitations
- No modification of Protobuf data
- Enums readable via
protobuf_get_int - Unsigned types not directly supported (no unsigned integers in PostgreSQL)
[packed=true]not supported by*_multiprocedures (useprotobuf_get_bytes*instead)