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

Commit0ad3c60

Browse files
committed
Rename contrib module basic_archive to basic_wal_module
This rename is in preparation for the introduction of recovery modules,where basic_wal_module will be used as a base template for the set ofcallbacks introduced. The former name did not really reflect all that.Author: Nathan BossartDiscussion:https://postgr.es/m/20221227192449.GA3672473@nathanxps13
1 parent239b175 commit0ad3c60

17 files changed

+105
-78
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_archive\
12+
basic_wal_module\
1313
basebackup_to_shell\
1414
bloom\
1515
btree_gin\

‎contrib/basic_archive/basic_archive.conf

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

‎contrib/basic_archive/meson.build

Lines changed: 0 additions & 34 deletions
This file was deleted.
File renamed without changes.

‎contrib/basic_archive/Makefilerenamed to‎contrib/basic_wal_module/Makefile

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

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

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",
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",
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_archive
17+
subdir = contrib/basic_wal_module
1818
top_builddir = ../..
1919
include$(top_builddir)/src/Makefile.global
2020
include$(top_srcdir)/contrib/contrib-global.mk

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*-------------------------------------------------------------------------
22
*
3-
*basic_archive.c
3+
*basic_wal_module.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_archive/basic_archive.c
23+
* contrib/basic_wal_module/basic_wal_module.c
2424
*
2525
*-------------------------------------------------------------------------
2626
*/
@@ -41,7 +41,7 @@
4141
PG_MODULE_MAGIC;
4242

4343
staticchar*archive_directory=NULL;
44-
staticMemoryContextbasic_archive_context;
44+
staticMemoryContextbasic_wal_module_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_archive.archive_directory",
60+
DefineCustomStringVariable("basic_wal_module.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_archive");
69+
MarkGUCPrefixReserved("basic_wal_module");
7070

71-
basic_archive_context=AllocSetContextCreate(TopMemoryContext,
72-
"basic_archive",
73-
ALLOCSET_DEFAULT_SIZES);
71+
basic_wal_module_context=AllocSetContextCreate(TopMemoryContext,
72+
"basic_wal_module",
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_archive_context);
159+
oldcontext=MemoryContextSwitchTo(basic_wal_module_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_archive_context);
186+
MemoryContextReset(basic_wal_module_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_archive_context);
209+
MemoryContextReset(basic_wal_module_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_archive",file)));
224+
(errmsg("archiving \"%s\" viabasic_wal_module",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_archive",file)));
288+
(errmsg("archived \"%s\" viabasic_wal_module",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_wal_module'
3+
basic_wal_module.archive_directory = '.'
4+
wal_level = replica

‎contrib/basic_wal_module/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_wal_module_sources=files(
4+
'basic_wal_module.c',
5+
)
6+
7+
if host_system=='windows'
8+
basic_wal_module_sources+= rc_lib_gen.process(win32ver_rc,extra_args: [
9+
'--NAME','basic_wal_module',
10+
'--FILEDESC','basic_wal_module - basic write-ahead log module',])
11+
endif
12+
13+
basic_wal_module=shared_module('basic_wal_module',
14+
basic_wal_module_sources,
15+
kwargs: contrib_mod_args,
16+
)
17+
contrib_targets+= basic_wal_module
18+
19+
tests+= {
20+
'name':'basic_wal_module',
21+
'sd':meson.current_source_dir(),
22+
'bd':meson.current_build_dir(),
23+
'regress': {
24+
'sql': [
25+
'basic_wal_module',
26+
],
27+
'regress_args': [
28+
'--temp-config',files('basic_wal_module.conf'),
29+
],
30+
# Disabled because these tests require "shared_preload_libraries=basic_wal_module",
31+
# which typical runningcheck users do not have (e.g. buildfarm clients).
32+
'runningcheck':false,
33+
},
34+
}

‎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_archive')
14+
subdir('basic_wal_module')
1515
subdir('bloom')
1616
subdir('basebackup_to_shell')
1717
subdir('bool_plperl')
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- doc/src/sgml/appendix-obsolete-basic-archive.sgml -->
2+
<!--
3+
See doc/src/sgml/appendix-obsolete.sgml for why this file exists. Do not change the id attribute.
4+
-->
5+
6+
<sect1 id="basic-archive" xreflabel="basic_archive">
7+
<title><command>basic_archive</command> renamed to <command>basic_wal_module</command></title>
8+
9+
<indexterm>
10+
<primary>basic_archive</primary>
11+
<see>basic_wal_module</see>
12+
</indexterm>
13+
14+
<para>
15+
PostgreSQL 15 provided an archive module named
16+
<filename>basic_archive</filename>
17+
<indexterm><primary>basic_archive</primary></indexterm>.
18+
This module was renamed to <filename>basic_wal_module</filename>. See
19+
<xref linkend="basic-wal-module"/> for documentation of
20+
<filename>basic_wal_module</filename>, and see
21+
<link linkend="release-prior">the release notes for PostgreSQL 16</link>
22+
for details on this change.
23+
</para>
24+
25+
</sect1>

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

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

4243
</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_archive</filename> module contains a working
35+
The <filename>contrib/basic_wal_module</filename> module contains a working
3636
example, which demonstrates some useful techniques.
3737
</para>
3838

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

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

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

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

1010
<para>
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
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
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-archive-configuration-parameters">
24+
<sect2 id="basic-wal-module-configuration-parameters">
2525
<title>Configuration Parameters</title>
2626

2727
<variablelist>
2828
<varlistentry>
2929
<term>
30-
<varname>basic_archive.archive_directory</varname> (<type>string</type>)
30+
<varname>basic_wal_module.archive_directory</varname> (<type>string</type>)
3131
<indexterm>
32-
<primary><varname>basic_archive.archive_directory</varname> configuration parameter</primary>
32+
<primary><varname>basic_wal_module.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_archive'
56-
basic_archive.archive_directory = '/path/to/archive/directory'
55+
archive_library = 'basic_wal_module'
56+
basic_wal_module.archive_directory = '/path/to/archive/directory'
5757
</programlisting>
5858
</sect2>
5959

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

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

73-
<sect2 id="basic-archive-author">
73+
<sect2 id="basic-wal-module-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-archive;
108+
&basic-wal-module;
109109
&bloom;
110110
&btree-gin;
111111
&btree-gist;

‎doc/src/sgml/filelist.sgml

Lines changed: 2 additions & 1 deletion
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-archiveSYSTEM "basic-archive.sgml">
119+
<!ENTITY basic-wal-moduleSYSTEM "basic-wal-module.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,3 +200,4 @@
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