Skip to content

Commit

Permalink
Release 1.4.0 (#423)
Browse files Browse the repository at this point in the history
 - update CHANGELOG date
 - add Postgres 13 to the list of supported Postgres versions
 - merge changes from vendored-in Postgres source files.
 - we don't have HAVE_STRCHRNUL defined in our compile environment.
 - add some comments about the funny business with Postgres source edits.
  • Loading branch information
DimCitus committed Sep 23, 2020
1 parent 4aef33d commit d763616
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
@@ -1,4 +1,4 @@
### pg_auto_failover v1.4.0 (September 2, 2020) ###
### pg_auto_failover v1.4.0 (September 23, 2020) ###

The main focus of this release is the new capability of pg_auto_failover to
manage any number of standby nodes, where it used to manage only a single
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -41,7 +41,7 @@ the _replication quorum_ of Postgres.
## Dependencies

At runtime, pg_auto_failover depends on only Postgres. Postgres versions 10,
11, and 12 are currently supported.
11, 12, and 13 are currently supported.

At buildtime. pg_auto_failover depends on Postgres server development
package like any other Postgres extensions (the server development package
Expand Down
22 changes: 10 additions & 12 deletions src/bin/lib/pg/snprintf.c
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -32,9 +32,6 @@
*/

#include "postgres_fe.h"

#ifndef USE_REPL_SNPRINTF

#include "snprintf.h"

#include <math.h>
Expand Down Expand Up @@ -341,6 +338,11 @@ static void leading_pad(int zpad, int signvalue, int *padlen,
PrintfTarget *target);
static void trailing_pad(int padlen, PrintfTarget *target);


/*
* While Postgres sources do it the smart way and check HAVE_STRCHRNUL from the
* auto-configure output, we just use the Postgres version of strchrnul here.
*/
static inline const char *
pg_strchrnul(const char *s, int c)
{
Expand Down Expand Up @@ -1033,7 +1035,7 @@ fmtint(long long value, char type, int forcesign, int leftjust,
}

/* disable MSVC warning about applying unary minus to an unsigned value */
#if _MSC_VER
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4146)
#endif
Expand All @@ -1042,7 +1044,7 @@ fmtint(long long value, char type, int forcesign, int leftjust,
uvalue = -(unsigned long long) value;
else
uvalue = (unsigned long long) value;
#if _MSC_VER
#ifdef _MSC_VER
#pragma warning(pop)
#endif

Expand Down Expand Up @@ -1208,16 +1210,14 @@ fmtfloat(double value, char type, int forcesign, int leftjust,
{
/* pad before exponent */
dostr(convert, epos - convert, target);
if (zeropadlen > 0)
dopr_outchmulti('0', zeropadlen, target);
dopr_outchmulti('0', zeropadlen, target);
dostr(epos, vallen - (epos - convert), target);
}
else
{
/* no exponent, pad after the digits */
dostr(convert, vallen, target);
if (zeropadlen > 0)
dopr_outchmulti('0', zeropadlen, target);
dopr_outchmulti('0', zeropadlen, target);
}
}
else
Expand Down Expand Up @@ -1494,5 +1494,3 @@ trailing_pad(int padlen, PrintfTarget *target)
if (padlen < 0)
dopr_outchmulti(' ', -padlen, target);
}

#endif /* USE_REPL_SNPRINTF */
7 changes: 1 addition & 6 deletions src/bin/lib/pg/strerror.c
Expand Up @@ -3,7 +3,7 @@
* strerror.c
* Replacements for standard strerror() and strerror_r() functions
*
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
Expand All @@ -13,11 +13,8 @@
*-------------------------------------------------------------------------
*/
#include "postgres_fe.h"

#include "snprintf.h"

#ifndef USE_REPL_SNPRINTF

/*
* Within this file, "strerror" means the platform's function not pg_strerror,
* and likewise for "strerror_r"
Expand Down Expand Up @@ -324,5 +321,3 @@ win32_socket_strerror(int errnum, char *buf, size_t buflen)
}

#endif /* WIN32 */

#endif /* USE_REPL_SNPRINTF */
2 changes: 1 addition & 1 deletion src/bin/pg_autoctl/cli_common.c
Expand Up @@ -1187,7 +1187,7 @@ keeper_cli_print_version(int argc, char **argv)
"pg_autoctl extension version %s\n",
PG_AUTOCTL_EXTENSION_VERSION);
fformat(stdout, "compiled with %s\n", PG_VERSION_STR);
fformat(stdout, "compatible with Postgres 10, 11, and 12\n");
fformat(stdout, "compatible with Postgres 10, 11, 12, and 13\n");
}

exit(0);
Expand Down

0 comments on commit d763616

Please sign in to comment.