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/Makefilerenamed 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.crenamed 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

‎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+
}

‎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.

‎contrib/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ subdir('adminpack')
1111
subdir('amcheck')
1212
subdir('auth_delay')
1313
subdir('auto_explain')
14-
subdir('basic_wal_module')
14+
subdir('basic_archive')
1515
subdir('bloom')
1616
subdir('basebackup_to_shell')
1717
subdir('bool_plperl')

‎doc/src/sgml/appendix-obsolete-basic-archive.sgml

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

‎doc/src/sgml/appendix-obsolete.sgml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@
3838
&obsolete-pgxlogdump;
3939
&obsolete-pgresetxlog;
4040
&obsolete-pgreceivexlog;
41-
&obsolete-basic-archive;
4241

4342
</appendix>

‎doc/src/sgml/archive-modules.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</para>
3333

3434
<para>
35-
The <filename>contrib/basic_wal_module</filename> module contains a working
35+
The <filename>contrib/basic_archive</filename> module contains a working
3636
example, which demonstrates some useful techniques.
3737
</para>
3838

‎doc/src/sgml/basic-wal-module.sgmlrenamed to‎doc/src/sgml/basic-archive.sgml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<!-- doc/src/sgml/basic-wal-module.sgml -->
1+
<!-- doc/src/sgml/basic-archive.sgml -->
22

3-
<sect1 id="basic-wal-module" xreflabel="basic_wal_module">
4-
<title>basic_wal_module &mdash; an examplewrite-ahead log module</title>
3+
<sect1 id="basic-archive" xreflabel="basic_archive">
4+
<title>basic_archive &mdash; an exampleWAL archive module</title>
55

6-
<indexterm zone="basic-wal-module">
7-
<primary>basic_wal_module</primary>
6+
<indexterm zone="basic-archive">
7+
<primary>basic_archive</primary>
88
</indexterm>
99

1010
<para>
11-
<filename>basic_wal_module</filename> is an example of an archive module.
12-
Thismodule copies completed WAL segment files to the specified directory.
13-
Thismay not be especially useful, but it can serve as a starting point for
11+
<filename>basic_archive</filename> is an example of an archive module. This
12+
module copies completed WAL segment files to the specified directory. This
13+
may not be especially useful, but it can serve as a starting point for
1414
developing your own archive module. For more information about archive
1515
modules, see <xref linkend="archive-modules"/>.
1616
</para>
@@ -21,15 +21,15 @@
2121
must be enabled.
2222
</para>
2323

24-
<sect2 id="basic-wal-module-configuration-parameters">
24+
<sect2 id="basic-archive-configuration-parameters">
2525
<title>Configuration Parameters</title>
2626

2727
<variablelist>
2828
<varlistentry>
2929
<term>
30-
<varname>basic_wal_module.archive_directory</varname> (<type>string</type>)
30+
<varname>basic_archive.archive_directory</varname> (<type>string</type>)
3131
<indexterm>
32-
<primary><varname>basic_wal_module.archive_directory</varname> configuration parameter</primary>
32+
<primary><varname>basic_archive.archive_directory</varname> configuration parameter</primary>
3333
</indexterm>
3434
</term>
3535
<listitem>
@@ -52,12 +52,12 @@
5252
<programlisting>
5353
# postgresql.conf
5454
archive_mode = 'on'
55-
archive_library = 'basic_wal_module'
56-
basic_wal_module.archive_directory = '/path/to/archive/directory'
55+
archive_library = 'basic_archive'
56+
basic_archive.archive_directory = '/path/to/archive/directory'
5757
</programlisting>
5858
</sect2>
5959

60-
<sect2 id="basic-wal-module-notes">
60+
<sect2 id="basic-archive-notes">
6161
<title>Notes</title>
6262

6363
<para>
@@ -70,7 +70,7 @@ basic_wal_module.archive_directory = '/path/to/archive/directory'
7070
</para>
7171
</sect2>
7272

73-
<sect2 id="basic-wal-module-author">
73+
<sect2 id="basic-archive-author">
7474
<title>Author</title>
7575

7676
<para>

‎doc/src/sgml/contrib.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ CREATE EXTENSION <replaceable>extension_name</replaceable>;
105105
&auth-delay;
106106
&auto-explain;
107107
&basebackup-to-shell;
108-
&basic-wal-module;
108+
&basic-archive;
109109
&bloom;
110110
&btree-gin;
111111
&btree-gist;

‎doc/src/sgml/filelist.sgml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<!ENTITY amcheck SYSTEM "amcheck.sgml">
117117
<!ENTITY auth-delay SYSTEM "auth-delay.sgml">
118118
<!ENTITY auto-explain SYSTEM "auto-explain.sgml">
119-
<!ENTITY basic-wal-moduleSYSTEM "basic-wal-module.sgml">
119+
<!ENTITY basic-archiveSYSTEM "basic-archive.sgml">
120120
<!ENTITY basebackup-to-shell SYSTEM "basebackup-to-shell.sgml">
121121
<!ENTITY bloom SYSTEM "bloom.sgml">
122122
<!ENTITY btree-gin SYSTEM "btree-gin.sgml">
@@ -200,4 +200,3 @@
200200
<!ENTITY obsolete-pgxlogdump SYSTEM "appendix-obsolete-pgxlogdump.sgml">
201201
<!ENTITY obsolete-pgresetxlog SYSTEM "appendix-obsolete-pgresetxlog.sgml">
202202
<!ENTITY obsolete-pgreceivexlog SYSTEM "appendix-obsolete-pgreceivexlog.sgml">
203-
<!ENTITY obsolete-basic-archive SYSTEM "appendix-obsolete-basic-archive.sgml">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp