Skip to content

Commit 1f954e7

Browse files
author
Nikita Malakhov
committed
bytea_appendable_toaster contrib module (extension)
Contrib module implements Custom toaster for non-compressed bytea columns, which allows fast appending to existing bytea value. Appended tail is stored directly in toaster pointer, if there is enough place to do it. Also modifies concatenation operation for bytea datatype - byteacat() with append operation for TOASTed values. Author: Teodor Sigaev <[email protected]> Author: Oleg Bartunov <[email protected]> Author: Nikita Glukhov <[email protected]> Author: Nikita Malakhov <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected]
1 parent 4be273a commit 1f954e7

File tree

11 files changed

+824
-2
lines changed

11 files changed

+824
-2
lines changed

contrib/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SUBDIRS = \
1414
bloom \
1515
btree_gin \
1616
btree_gist \
17+
bytea_toaster \
1718
citext \
1819
cube \
1920
dblink \

contrib/bytea_toaster/Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# contrib/bytea_toaster/Makefile
2+
3+
MODULE_big = bytea_toaster
4+
OBJS = \
5+
$(WIN32RES) \
6+
bytea_toaster.o
7+
8+
EXTENSION = bytea_toaster
9+
DATA = bytea_toaster--1.0.sql
10+
PGFILEDESC = "bytea_toaster - appendable bytea toaster"
11+
12+
REGRESS = bytea_toaster
13+
14+
ifdef USE_PGXS
15+
PG_CONFIG = pg_config
16+
PGXS := $(shell $(PG_CONFIG) --pgxs)
17+
include $(PGXS)
18+
else
19+
subdir = contrib/bytea_toaster
20+
top_builddir = ../..
21+
include $(top_builddir)/src/Makefile.global
22+
include $(top_srcdir)/contrib/contrib-global.mk
23+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* contrib/bytea_toaster/bytea_toaster--1.0.sql */
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION bytea_toaster" to load this file. \quit
5+
6+
CREATE FUNCTION bytea_toaster_handler(internal)
7+
RETURNS toaster_handler
8+
AS 'MODULE_PATHNAME'
9+
LANGUAGE C;
10+
11+
CREATE TOASTER bytea_toaster HANDLER bytea_toaster_handler;
12+
13+
COMMENT ON TOASTER bytea_toaster IS 'bytea_toaster is a appendable bytea toaster';

0 commit comments

Comments
 (0)