{"id":18055979,"url":"https://github.com/grahamedgecombe/pgzstd","last_synced_at":"2025-04-11T02:06:33.420Z","repository":{"id":66305302,"uuid":"84469034","full_name":"grahamedgecombe/pgzstd","owner":"grahamedgecombe","description":"Postgres module for Zstandard compression/decompression with preset dictionary support","archived":false,"fork":false,"pushed_at":"2018-10-18T20:23:41.000Z","size":14,"stargazers_count":39,"open_issues_count":3,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T02:04:29.393Z","etag":null,"topics":["postgresql","zstandard","zstd"],"latest_commit_sha":null,"homepage":"https://www.grahamedgecombe.com/projects/pgzstd","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grahamedgecombe.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-09T17:17:02.000Z","updated_at":"2024-10-29T12:12:12.000Z","dependencies_parsed_at":"2023-02-21T02:46:10.533Z","dependency_job_id":null,"html_url":"https://github.com/grahamedgecombe/pgzstd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamedgecombe%2Fpgzstd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamedgecombe%2Fpgzstd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamedgecombe%2Fpgzstd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahamedgecombe%2Fpgzstd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grahamedgecombe","download_url":"https://codeload.github.com/grahamedgecombe/pgzstd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328168,"owners_count":21085261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","zstandard","zstd"],"created_at":"2024-10-31T01:13:06.858Z","updated_at":"2025-04-11T02:06:33.394Z","avatar_url":"https://github.com/grahamedgecombe.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgzstd\n\n## Introduction\n\npgzstd is a PostgreSQL extension that provides functions for compressing and\nuncompressing [Zstandard][zstd] frames, with support for custom dictionaries.\n\n## Prerequisites\n\n* PostgreSQL headers, libraries and PGXS build infrastructure\n* `pg_config` must be in your `PATH`\n* Zstandard\n\n## Building\n\nRun `make` to build the extension.\n\n## Installation\n\nRun `make install` as `root` (e.g. with `sudo`) to install the extension.\n\n## Debian package\n\nThe repository also contains the files for building a Debian package, which can\nbe done by running `pg_buildext updatecontrol` followed by `dpkg-buildpackage`.\nI distribute pre-built versions for stable amd64 Debian using the\n[apt.postgresql.org][pgapt] repository in my [personal APT repository][apt]. Run\n`apt-get install postgresql-PGVERSION-zstd` as root after setting up the\nrepository.\n\n## Usage\n\nRun `CREATE EXTENSION zstd` to install the extension in the current database.\nThree functions are provided:\n\n| Function                                                                                | Return Type |\n|-----------------------------------------------------------------------------------------|-------------|\n| \u003ccode\u003ezstd\\_compress(*data* bytea [, *dictionary* bytea [, *level* integer ]])\u003c/code\u003e   | `bytea`     |\n| \u003ccode\u003ezstd\\_decompress(*data* bytea [, *dictionary* bytea ])\u003c/code\u003e                     | `bytea`     |\n| \u003ccode\u003ezstd\\_length(*data* bytea)\u003c/code\u003e                                                 | `integer`   |\n\n`zstd_compress` compresses the provided `data` and returns a Zstandard frame. A\npreset `dictionary` may also be provided. The default compression `level` may\nalso be overriden, valid values range from `1` (best speed) to `22` (best\ncompression). The default level is `3`.\n\nIf you want to override the compression level without using a dictionary, set\n`dictionary` to `NULL`.\n\n`zstd_decompress` decompresses the provided Zstandard frame in `data` and\nreturns the uncompressed data. A preset `dictionary`, matching the dictionary\nused to compress the data, may also be provided.\n\n`zstd_length` returns the decompressed length of the provided Zstandard frame.\nIf `ZSTD_getFrameContentSize()` is available it returns `NULL` if the length is\nunknown. If unavailable, it isn't possible to distinguish the error, unknown\ndecompressed length and zero decompressed length cases.\n\n## Example\n\n    gpe=# CREATE EXTENSION zstd;\n    CREATE EXTENSION\n    gpe=# SELECT zstd_compress('hello hello hello hello', 'hello hello', 3);\n                zstd_compress\n    --------------------------------------\n     \\x28b52ffd2017450000000200291c6c1420\n    (1 row)\n\n    gpe=# SELECT convert_from(zstd_decompress('\\x28b52ffd2017450000000200291c6c1420', 'hello hello'), 'utf-8');\n          convert_from\n    -------------------------\n     hello hello hello hello\n    (1 row)\n\n    gpe=# SELECT zstd_length('\\x28b52ffd2017450000000200291c6c1420');\n     zstd_length\n    -------------\n              23\n    (1 row)\n\n    gpe=#\n\n## License\n\nThis project is available under the terms of the ISC license, which is similar\nto the 2-clause BSD license. See the `LICENSE` file for the copyright\ninformation and licensing terms.\n\n[zstd]: http://www.zstd.net/\n[pgapt]: https://wiki.postgresql.org/wiki/Apt\n[apt]: https://www.grahamedgecombe.com/apt-repository\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahamedgecombe%2Fpgzstd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrahamedgecombe%2Fpgzstd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahamedgecombe%2Fpgzstd/lists"}