In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article briefly introduces the plug-in for PostgreSQL: pgsql-gzip. The plug-in can be used to encrypt and decrypt columns.
Installation
Clone code, compiling and installing
[pg12@localhost contrib] $git clone https://github.com/pramsey/pgsql-gzip.gitCloning into 'pgsql-gzip'...remote: Enumerating objects, done.remote: Counting objects: 100% (114), done.remote: Compressing objects: 100% (71), done.remote: Total 114 (delta 63), reused 81 (delta 35), pack-reused 0Receiving objects: 100% (114), 18.56 KiB | 0 bytes/s, done.Resolving deltas: 100% (63max 63) Done. [pg12@localhost contrib] $cd pgsql-gzip/ [pg12@localhost pgsql-gzip] $makegcc-std=gnu99-Wall-Wmissing-prototypes-Wpointer-arith-Wdeclaration-after-statement-Werror=vla-Wendif-labels-Wmissing-format-attribute-Wformat-security-fno-strict-aliasing-fwrapv-fexcess-precision=standard-gO0-DOPTIMIZER_DEBUG-G3-gdwarf-2-fPIC-I. -I. /-I/appdb/pg12/pg12.0/include/postgresql/server-I/appdb/pg12/pg12.0/include/postgresql/internal-D_GNU_SOURCE-I/usr/include/libxml2-c-o pg_gzip.o pg_gzip.c-MMD-MP-MF .deps / pg_gzip.Pogcc-std=gnu99-Wall-Wmissing-prototypes-Wpointer-arith-Wdeclaration-after-statement-Werror=vla-Wendif-labels-Wmissing-format-attribute-Wformat-security-fno-strict- Aliasing-fwrapv-fexcess-precision=standard-g-O0-DOPTIMIZER_DEBUG-G3-gdwarf-2-fPIC-shared-o gzip.so pg_gzip.o-L/appdb/pg12/pg12.0/lib-Wl -- as-needed-Wl,-rpath,'/appdb/pg12/pg12.0/lib' -- enable-new-dtags-lz [pg12@localhost pgsql-gzip] $make install/bin/mkdir-p'/ appdb/pg12/pg12.0/lib/postgresql'/bin/mkdir-p'/ appdb/pg12/pg12.0/share/postgresql/extension'/bin/mkdir-p'/ appdb/pg12/pg12.0/share/postgresql/extension'/bin/install-c-m 755 gzip.so'/ appdb/pg12/pg12.0/lib/postgresql/gzip.so'/bin/install -c-m 644. / / gzip.control'/ appdb/pg12/pg12.0/share/postgresql/extension/'/bin/install-c-m 644. / / gzip--1.0.sql'/ appdb/pg12/pg12.0/share/postgresql/extension/' [pg12@localhost pgsql-gzip] $make installcheck/appdb/pg12/pg12.0/lib/postgresql/pgxs/src/makefiles/../../src/test/regress/pg_regress-- inputdir=./-- bindir= '/ appdb/pg12/pg12.0/bin'-- dbname=contrib_regression gzip (using postmaster on Unix socket Default port) = dropping database "contrib_regression" = DROP DATABASE= creating database "contrib_regression" = CREATE DATABASEALTER DATABASE= running regression test queries = test gzip. Ok 253 ms= All 1 tests passed. = [pg12@localhost pgsql-gzip] $
Experience
Create an extension
[local]: 5432 pg12@testdb=# create extension gzippg12@testdb-#; CREATE EXTENSION [local]: 5432 pg12@testdb=#
The main functions include gzip and gunzip
[local]: 5432 pg12@testdb=#\ df gzip List of functions Schema | Name | Result data type | Argument data types | Type-+- -+-public | gzip | bytea | uncompressed bytea Compression_level integer DEFAULT'- 1'::integer | func public | gzip | bytea | uncompressed text Compression_level integer DEFAULT'- 1'::integer | func (2 rows) [local]: 5432 pg12@testdb=#\ df gunzip List of functions Schema | Name | Result data type | Argument data types | Type-+-- -public | gunzip | bytea | compressed bytea | func (1 row)
Compression / decompression
[local]: 5432 pg12@testdb=# select gzip ('Test data 123 Test') Gzip -\ x1f8b08000000000000037bb6b5fbc5faa9cfa66e78d6bbced0c8f819980b00299ee5af15000000 (1 row) [local]: 5432 pg12@testdb=# select gunzip ('\ x1f8b08000000000000037bb6b5fbc5faa9cfa66e78d6bbced0c8f819980b00299ee5af15000000'::bytea) Gunzip -\ xe6b58be8af95e695b0e68dae313233e6b58be8af95 (1 row) [local]: 5432 pg12@testdb=# select gunzip (gzip) Gunzip -\ xe6b58be8af95e695b0e68dae313233e6b58be8af95 (1 row) [local]: 5432 pg12@testdb=# [local]: 5432 pg12@testdb=# select 'Test data 123 Test':: bytea Bytea -\ xe6b58be8af95e695b0e68dae313233e6b58be8af95 (1 row) [local]: 5432 pg12@testdb=#
Opaque compression and decompression can be achieved through pgsql-gzip.
references
Pgsql-gzip
GZip in PostgreSQL
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.