Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9aeff09

Browse files
committed
Revert "Rename contrib module basic_archive to basic_wal_module"
This reverts commit0ad3c60, as per feedback from Tom Lane, Robert Haasand Andres Freund. The new name used for the module had littlesupport.This moves back to basic_archive as module name, and we will likely usethat as template for recovery modules, as well.Discussion:https://postgr.es/m/CA+TgmoYG5uGOp7DGFT5gzC1kKFWGjkLSj_wOQxGhfMcvVEiKGA@mail.gmail.com
1 parent1a8e72b commit9aeff09

17 files changed

+78
-105
lines changed

‎contrib/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SUBDIRS = \
99
amcheck\
1010
auth_delay\
1111
auto_explain\
12-
basic_wal_module\
12+
basic_archive\
1313
basebackup_to_shell\
1414
bloom\
1515
btree_gin\
File renamed without changes.

‎contrib/basic_wal_module/Makefile‎renamed to ‎contrib/basic_archive/Makefile‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# contrib/basic_wal_module/Makefile
1+
# contrib/basic_archive/Makefile
22

3-
MODULES =basic_wal_module
4-
PGFILEDESC = "basic_wal_module - basicwrite-ahead log module"
3+
MODULES =basic_archive
4+
PGFILEDESC = "basic_archive - basicarchive module"
55

6-
REGRESS =basic_wal_module
7-
REGRESS_OPTS = --temp-config$(top_srcdir)/contrib/basic_wal_module/basic_wal_module.conf
8-
# Disabled because these tests require "shared_preload_libraries=basic_wal_module",
6+
REGRESS =basic_archive
7+
REGRESS_OPTS = --temp-config$(top_srcdir)/contrib/basic_archive/basic_archive.conf
8+
# Disabled because these tests require "shared_preload_libraries=basic_archive",
99
# which typical installcheck users do not have (e.g. buildfarm clients).
1010
NO_INSTALLCHECK = 1
1111

@@ -14,7 +14,7 @@ PG_CONFIG = pg_config
1414
PGXS :=$(shell$(PG_CONFIG) --pgxs)
1515
include$(PGXS)
1616
else
17-
subdir = contrib/basic_wal_module
17+
subdir = contrib/basic_archive
1818
top_builddir = ../..
1919
include$(top_builddir)/src/Makefile.global
2020
include$(top_srcdir)/contrib/contrib-global.mk

‎contrib/basic_wal_module/basic_wal_module.c‎renamed to ‎contrib/basic_archive/basic_archive.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*-------------------------------------------------------------------------
22
*
3-
*basic_wal_module.c
3+
*basic_archive.c
44
*
55
* This file demonstrates a basic archive library implementation that is
66
* roughly equivalent to the following shell command:
@@ -20,7 +20,7 @@
2020
* Copyright (c) 2022-2023, PostgreSQL Global Development Group
2121
*
2222
* IDENTIFICATION
23-
* contrib/basic_wal_module/basic_wal_module.c
23+
* contrib/basic_archive/basic_archive.c
2424
*
2525
*-------------------------------------------------------------------------
2626
*/
@@ -41,7 +41,7 @@
4141
PG_MODULE_MAGIC;
4242

4343
staticchar*archive_directory=NULL;
44-
staticMemoryContextbasic_wal_module_context;
44+
staticMemoryContextbasic_archive_context;
4545

4646
staticboolbasic_archive_configured(void);
4747
staticboolbasic_archive_file(constchar*file,constchar*path);
@@ -57,7 +57,7 @@ static bool compare_files(const char *file1, const char *file2);
5757
void
5858
_PG_init(void)
5959
{
60-
DefineCustomStringVariable("basic_wal_module.archive_directory",
60+
DefineCustomStringVariable("basic_archive.archive_directory",
6161
gettext_noop("Archive file destination directory."),
6262
NULL,
6363
&archive_directory,
@@ -66,11 +66,11 @@ _PG_init(void)
6666
0,
6767
check_archive_directory,NULL,NULL);
6868

69-
MarkGUCPrefixReserved("basic_wal_module");
69+
MarkGUCPrefixReserved("basic_archive");
7070

71-
basic_wal_module_context=AllocSetContextCreate(TopMemoryContext,
72-
"basic_wal_module",
73-
ALLOCSET_DEFAULT_SIZES);
71+
basic_archive_context=AllocSetContextCreate(TopMemoryContext,
72+
"basic_archive",
73+
ALLOCSET_DEFAULT_SIZES);
7474
}
7575

7676
/*
@@ -156,7 +156,7 @@ basic_archive_file(const char *file, const char *path)
156156
* we can easily reset it during error recovery (thus avoiding memory
157157
* leaks).
158158
*/
159-
oldcontext=MemoryContextSwitchTo(basic_wal_module_context);
159+
oldcontext=MemoryContextSwitchTo(basic_archive_context);
160160

161161
/*
162162
* Since the archiver operates at the bottom of the exception stack,
@@ -183,7 +183,7 @@ basic_archive_file(const char *file, const char *path)
183183

184184
/* Reset our memory context and switch back to the original one */
185185
MemoryContextSwitchTo(oldcontext);
186-
MemoryContextReset(basic_wal_module_context);
186+
MemoryContextReset(basic_archive_context);
187187

188188
/* Remove our exception handler */
189189
PG_exception_stack=NULL;
@@ -206,7 +206,7 @@ basic_archive_file(const char *file, const char *path)
206206

207207
/* Reset our memory context and switch back to the original one */
208208
MemoryContextSwitchTo(oldcontext);
209-
MemoryContextReset(basic_wal_module_context);
209+
MemoryContextReset(basic_archive_context);
210210

211211
return true;
212212
}
@@ -221,7 +221,7 @@ basic_archive_file_internal(const char *file, const char *path)
221221
uint64epoch;/* milliseconds */
222222

223223
ereport(DEBUG3,
224-
(errmsg("archiving \"%s\" viabasic_wal_module",file)));
224+
(errmsg("archiving \"%s\" viabasic_archive",file)));
225225

226226
snprintf(destination,MAXPGPATH,"%s/%s",archive_directory,file);
227227

@@ -285,7 +285,7 @@ basic_archive_file_internal(const char *file, const char *path)
285285
(void)durable_rename(temp,destination,ERROR);
286286

287287
ereport(DEBUG1,
288-
(errmsg("archived \"%s\" viabasic_wal_module",file)));
288+
(errmsg("archived \"%s\" viabasic_archive",file)));
289289
}
290290

291291
/*
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
archive_mode = on
2+
archive_library = 'basic_archive'
3+
basic_archive.archive_directory = '.'
4+
wal_level = replica
File renamed without changes.

‎contrib/basic_archive/meson.build‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
2+
3+
basic_archive_sources=files(
4+
'basic_archive.c',
5+
)
6+
7+
if host_system=='windows'
8+
basic_archive_sources+= rc_lib_gen.process(win32ver_rc,extra_args: [
9+
'--NAME','basic_archive',
10+
'--FILEDESC','basic_archive - basic archive module',])
11+
endif
12+
13+
basic_archive=shared_module('basic_archive',
14+
basic_archive_sources,
15+
kwargs: contrib_mod_args,
16+
)
17+
contrib_targets+= basic_archive
18+
19+
tests+= {
20+
'name':'basic_archive',
21+
'sd':meson.current_source_dir(),
22+
'bd':meson.current_build_dir(),
23+
'regress': {
24+
'sql': [
25+
'basic_archive',
26+
],
27+
'regress_args': [
28+
'--temp-config',files('basic_archive.conf'),
29+
],
30+
# Disabled because these tests require "shared_preload_libraries=basic_archive",
31+
# which typical runningcheck users do not have (e.g. buildfarm clients).
32+
'runningcheck':false,
33+
},
34+
}
File renamed without changes.

‎contrib/basic_wal_module/basic_wal_module.conf‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎contrib/basic_wal_module/meson.build‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp