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

Commit 82ac4c4

Browse files
Julien TachoiresCommitfest Bot
Julien Tachoires
authored and
Commitfest Bot
committed
Add the "dummy_table_am" test module
This test module is in charge of testing table AM reloptions. It's very similar to what we do in dummy_index_am as we have to exercise the exact same kind of feature.
1 parent 6d1d8c0 commit 82ac4c4

File tree

10 files changed

+948
-0
lines changed

10 files changed

+948
-0
lines changed

src/test/modules/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ SUBDIRS = \
99
commit_ts \
1010
delay_execution \
1111
dummy_index_am \
12+
dummy_table_am \
1213
dummy_seclabel \
1314
libpq_pipeline \
1415
oauth_validator \
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# src/test/modules/dummy_table_am/Makefile
2+
3+
MODULES = dummy_table_am
4+
5+
EXTENSION = dummy_table_am
6+
DATA = dummy_table_am--1.0.sql
7+
PGFILEDESC = "dummy_table_am - table access method template"
8+
9+
REGRESS = reloptions
10+
11+
ifdef USE_PGXS
12+
PG_CONFIG = pg_config
13+
PGXS := $(shell $(PG_CONFIG) --pgxs)
14+
include $(PGXS)
15+
else
16+
subdir = src/test/modules/dummy_table_am
17+
top_builddir = ../../../..
18+
include $(top_builddir)/src/Makefile.global
19+
include $(top_srcdir)/contrib/contrib-global.mk
20+
endif
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Dummy Table AM
2+
==============
3+
4+
Dummy table AM is a module for testing any facility usable by a table
5+
access method, whose code is kept a maximum simple.
6+
7+
This includes tests for all relation option types:
8+
- boolean
9+
- enum
10+
- integer
11+
- real
12+
- strings (with and without NULL as default)
13+
14+
It also includes tests related to unrecognized options.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* src/test/modules/dummy_table_am/dummy_table_am--1.0.sql */
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dummy_table_am" to load this file. \quit
5+
6+
CREATE FUNCTION dummy_table_am_handler(internal)
7+
RETURNS table_am_handler
8+
AS 'MODULE_PATHNAME'
9+
LANGUAGE C;
10+
11+
-- Access method
12+
CREATE ACCESS METHOD dummy_table_am TYPE TABLE HANDLER dummy_table_am_handler;
13+
COMMENT ON ACCESS METHOD dummy_table_am IS 'Dummy Table Access Method';

0 commit comments

Comments
 (0)