Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 18245cb

Browse files
author
Nikita Malakhov
committed
Default TOAST re-implemented using TOAST API.
Default TOAST mechanics extracted from Heap AM Core and re-implemented using Pluggable TOAST API as 'Default Toaster'. Default toaster is added as initial entry in PG_TOASTER table, with Toaster name 'deftoaster' and still is part of PostgreSQL core. Overall TOAST mechanics is kept the same, the difference is that from now on TOAST table initialization is done within Generic Toaster "init" functions, toast and detoast functions are called as Toaster with DEFAULT_TOASTER_OID via TOAST API. Default Toaster is attached to TOASTable column by default if not stated otherwise (by CREATE or ALTERD TABLE command option SET TOASTER). Default Toaster could be replaced with custom toaster by SET TOASTER clause in CREATE TABLE or ALTER TABLE command. Author: Teodor Sigaev <teodor@sigaev.ru> Author: Oleg Bartunov <obartunov@postgrespro.ru> Author: Nikita Glukhov <n.gluhov@postgrespro.ru> Author: Nikita Malakhov <n.malakhov@postgrespro.ru> Discussion: https://www.postgresql.org/message-id/flat/224711f9-83b7-a307-b17f-4457ab73aa0a@sigaev.ru
1 parent e5adf3b commit 18245cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1670
-1185
lines changed

contrib/amcheck/verify_heapam.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
#include "postgres.h"
1212

13-
#include "access/detoast.h"
13+
#include "access/toasterapi.h"
1414
#include "access/genam.h"
1515
#include "access/heapam.h"
1616
#include "access/heaptoast.h"
@@ -24,6 +24,8 @@
2424
#include "storage/procarray.h"
2525
#include "utils/builtins.h"
2626
#include "utils/fmgroids.h"
27+
#include "access/toast_helper.h"
28+
#include "catalog/toasting.h"
2729

2830
PG_FUNCTION_INFO_V1(verify_heapam);
2931

src/backend/access/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ top_builddir = ../../..
99
include $(top_builddir)/src/Makefile.global
1010

1111
SUBDIRS = brin common gin gist hash heap index nbtree rmgrdesc spgist \
12-
table tablesample transam
12+
table tablesample toast transam
1313

1414
include $(top_srcdir)/src/backend/common.mk

src/backend/access/brin/brin_tuple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
#include "postgres.h"
3333

3434
#include "access/brin_tuple.h"
35-
#include "access/detoast.h"
35+
#include "access/toasterapi.h"
3636
#include "access/heaptoast.h"
3737
#include "access/htup_details.h"
3838
#include "access/toast_internals.h"
3939
#include "access/tupdesc.h"
4040
#include "access/tupmacs.h"
4141
#include "utils/datum.h"
4242
#include "utils/memutils.h"
43-
43+
#include "access/toast_helper.h"
4444

4545
/*
4646
* This enables de-toasting of index entries. Needed until VACUUM is

src/backend/access/common/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ include $(top_builddir)/src/Makefile.global
1515
OBJS = \
1616
attmap.o \
1717
bufmask.o \
18-
detoast.o \
1918
heaptuple.o \
2019
indextuple.o \
2120
printsimple.o \

0 commit comments

Comments
 (0)