Skip to content

Commit ccae24d

Browse files
kulaginmGrigory Smolkin
authored andcommitted
#undef WIN32 (#3)
(remove Windows support)
1 parent 6807d81 commit ccae24d

20 files changed

+41
-874
lines changed

doc/pgprobackup.xml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,6 @@ doc/src/sgml/pgprobackup.sgml
406406
<application>pg_backup</application> only supports PostgreSQL 9.5 and higher.
407407
</para>
408408
</listitem>
409-
<listitem>
410-
<para>
411-
The remote mode is not supported on Windows systems.
412-
</para>
413-
</listitem>
414409
<listitem>
415410
<para>
416411
On Unix systems, for <productname>PostgreSQL</productname> 10 or lower,
@@ -1408,7 +1403,7 @@ pg_backup backup -B <replaceable>backup_dir</replaceable> --instance <replaceabl
14081403
use the optional <option>--external-dirs</option> parameter
14091404
that specifies the path to this directory. If you would like
14101405
to add more than one external directory, you can provide several paths
1411-
separated by colons on Linux systems or semicolons on Windows systems.
1406+
separated by colons on Linux systems.
14121407
</para>
14131408
<para>
14141409
For example, to include <filename>/etc/dir1</filename> and
@@ -1419,14 +1414,6 @@ pg_backup backup -B <replaceable>backup_dir</replaceable> --instance <replaceabl
14191414
</para>
14201415
<programlisting>
14211416
pg_backup backup -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> -b FULL --external-dirs=/etc/dir1:/etc/dir2
1422-
</programlisting>
1423-
<para>
1424-
Similarly, to include <filename>C:\dir1</filename> and
1425-
<filename>C:\dir2</filename> directories into the full backup
1426-
on Windows, run:
1427-
</para>
1428-
<programlisting>
1429-
pg_backup backup -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> -b FULL --external-dirs=C:\dir1;C:\dir2
14301417
</programlisting>
14311418
<para>
14321419
<application>pg_backup</application> recursively copies the contents
@@ -2076,12 +2063,6 @@ restore_command = '"<replaceable>install_dir</replaceable>/pg_backup" archive-ge
20762063
<programlisting>
20772064
pg_backup restore -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> --remote-user=postgres --remote-host=192.168.0.2 --remote-port=2302 --restore-command='"<replaceable>install_dir</replaceable>/pg_backup" archive-get -B "<replaceable>backup_dir</replaceable>" --instance <replaceable>instance_name</replaceable> --wal-file-path=%p --wal-file-name=%f --remote-host=192.168.0.3 --remote-port=2303 --remote-user=backup'
20782065
</programlisting>
2079-
<note>
2080-
<para>
2081-
The remote mode is currently unavailable for
2082-
Windows systems.
2083-
</para>
2084-
</note>
20852066
</refsect2>
20862067
<refsect2 id="pbk-running-pg-probackup-on-parallel-threads">
20872068
<title>Running <application>pg_backup</application> on Parallel Threads</title>
@@ -2193,7 +2174,7 @@ pg_backup show-config -B <replaceable>backup_dir</replaceable> --instance <repla
21932174
<para>
21942175
If nothing is given, the default values are taken. By default
21952176
<application>pg_backup</application> tries to use local connection via Unix domain
2196-
socket (<literal>localhost</literal> on Windows) and tries to get the database name
2177+
socket and tries to get the database name
21972178
and the user name from the <envar>PGUSER</envar> environment variable or the
21982179
current OS user name.
21992180
</para>
@@ -3871,7 +3852,7 @@ pg_backup backup -B <replaceable>backup_dir</replaceable> -b <replaceable>backup
38713852
is useful to back up scripts, SQL dump files, and configuration
38723853
files located outside of the data directory. If you would like
38733854
to back up several external directories, separate their paths
3874-
by a colon on Unix and a semicolon on Windows.
3855+
by a colon on Unix.
38753856
</para>
38763857
</listitem>
38773858
</varlistentry>

gen_probackup_project.pl

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

src/backup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno)
23512351
{
23522352
/* We need critical section only we use more than one threads */
23532353
if (num_threads > 1)
2354-
pthread_lock(&backup_pagemap_mutex);
2354+
pthread_mutex_lock(&backup_pagemap_mutex);
23552355

23562356
datapagemap_add(&(*file_item)->pagemap, blkno_inseg);
23572357

src/data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@ write_page_headers(BackupPageHeader2 *headers, pgFile *file, HeaderMap *hdr_map,
24492449
read_len, ZLIB_COMPRESS, 1, &errormsg);
24502450

24512451
/* writing to header map must be serialized */
2452-
pthread_lock(&(hdr_map->mutex)); /* what if we crash while trying to obtain mutex? */
2452+
pthread_mutex_lock(&(hdr_map->mutex)); /* what if we crash while trying to obtain mutex? */
24532453

24542454
if (!hdr_map->fp)
24552455
{

src/dir.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,13 +1551,7 @@ make_external_directory_list(const char *colon_separated_dirs, bool remap)
15511551
parray *list = parray_new();
15521552
char *tmp = pg_strdup(colon_separated_dirs);
15531553

1554-
#ifndef WIN32
1555-
#define EXTERNAL_DIRECTORY_DELIMITER ":"
1556-
#else
1557-
#define EXTERNAL_DIRECTORY_DELIMITER ";"
1558-
#endif
1559-
1560-
p = strtok(tmp, EXTERNAL_DIRECTORY_DELIMITER);
1554+
p = strtok(tmp, ":");
15611555
while(p!=NULL)
15621556
{
15631557
char *external_path = pg_strdup(p);
@@ -1582,7 +1576,7 @@ make_external_directory_list(const char *colon_separated_dirs, bool remap)
15821576
elog(ERROR, "External directory \"%s\" is not an absolute path",
15831577
external_path);
15841578

1585-
p = strtok(NULL, EXTERNAL_DIRECTORY_DELIMITER);
1579+
p = strtok(NULL, ":");
15861580
}
15871581
pfree(tmp);
15881582
parray_qsort(list, pgCompareString);

src/help.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ help_command(ProbackupSubcmd const subcmd)
6767
&help_set_backup,
6868
&help_show_config,
6969
&help_checkdb,
70-
&help_internal, // SSH_CMD
70+
&help_nocmd, // SSH_CMD
7171
&help_internal, // AGENT_CMD
7272
&help_help,
7373
&help_version,

0 commit comments

Comments
 (0)