summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarina Litskevich2023-09-01 08:01:46 +0000
committerChristoph Berg2023-09-14 10:10:21 +0000
commit80a69ad2afb91f245764793d45df5d83a58ec0dc (patch)
treed804c5273c950b4da131c4f38d98e63fecbc2d5c
parent79cbcd8e282177b400d4d19de90b95a28b9425a0 (diff)
Add support for PostgreSQL v16
-rw-r--r--decode.c14
-rw-r--r--pg_filedump.c2
-rw-r--r--stringinfo.c4
3 files changed, 19 insertions, 1 deletions
diff --git a/decode.c b/decode.c
index bf28189..7542b9d 100644
--- a/decode.c
+++ b/decode.c
@@ -244,6 +244,7 @@ static bool copyStringInitDone = false;
static char decompress_tmp_buff[64 * 1024];
/* Used by some PostgreSQL macro definitions */
+#if PG_VERSION_NUM < 160000
void
ExceptionalCondition(const char *conditionName,
const char *errorType,
@@ -257,6 +258,19 @@ ExceptionalCondition(const char *conditionName,
lineNumber);
exit(1);
}
+#else
+void
+ExceptionalCondition(const char *conditionName,
+ const char *fileName,
+ int lineNumber)
+{
+ printf("Exceptional condition: name = %s, type = FailedAssertion, fname = %s, line = %d\n",
+ conditionName ? conditionName : "(NULL)",
+ fileName ? fileName : "(NULL)",
+ lineNumber);
+ exit(1);
+}
+#endif
/* Append given string to current COPY line */
static void
diff --git a/pg_filedump.c b/pg_filedump.c
index 8b6be98..c4f2989 100644
--- a/pg_filedump.c
+++ b/pg_filedump.c
@@ -681,7 +681,7 @@ GetBlockSize(FILE *fp)
rewind(fp);
if (bytesRead == sizeof(PageHeaderData))
- localSize = (unsigned int) PageGetPageSize(&localCache);
+ localSize = (unsigned int) PageGetPageSize(localCache);
else
{
printf("Error: Unable to read full page header from block 0.\n"
diff --git a/stringinfo.c b/stringinfo.c
index 8d54bee..637d643 100644
--- a/stringinfo.c
+++ b/stringinfo.c
@@ -75,7 +75,11 @@ appendStringInfoString(StringInfo str, const char *s)
* if necessary.
*/
void
+#if PG_VERSION_NUM < 160000
appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
+#else
+appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
+#endif
{
assert(str != NULL);