Skip to content

Commit

Permalink
Update to Postgres 10.16 and refresh source with new patches
Browse files Browse the repository at this point in the history
  • Loading branch information
lfittl committed Feb 18, 2021
1 parent 9118cfc commit 252cded
Show file tree
Hide file tree
Showing 18 changed files with 2,003 additions and 1,995 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARLIB = lib$(TARGET).a
PGDIR = $(root_dir)/tmp/postgres
PGDIRBZ2 = $(root_dir)/tmp/postgres.tar.bz2

PG_VERSION = 10.15
PG_VERSION = 10.16

SRC_FILES := $(wildcard src/*.c src/postgres/*.c)
OBJ_FILES := $(SRC_FILES:.c=.o)
Expand Down
4 changes: 2 additions & 2 deletions pg_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ void pg_query_free_fingerprint_result(PgQueryFingerprintResult result);
void pg_query_exit(void);

// Postgres version information
#define PG_VERSION "10.15"
#define PG_VERSION "10.16"
#define PG_MAJORVERSION "10"
#define PG_VERSION_NUM 100015
#define PG_VERSION_NUM 100016

// Deprecated APIs below

Expand Down
2 changes: 2 additions & 0 deletions src/postgres/include/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1224,3 +1224,5 @@ extern unsigned long long strtoull(const char *str, char **endptr, int base);
#include "port.h"

#endif /* C_H */
#undef StaticAssertDecl
#define StaticAssertDecl(condition, errmessage)
2 changes: 1 addition & 1 deletion src/postgres/include/nodes/memnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct MemoryContextData
/* these two fields are placed here to minimize alignment wastage: */
bool isReset; /* T = no space alloced since last reset */
bool allowInCritSection; /* allow palloc in critical section */
MemoryContextMethods *methods; /* virtual function table */
const MemoryContextMethods *methods; /* virtual function table */
MemoryContext parent; /* NULL if no parent (toplevel context) */
MemoryContext firstchild; /* head of linked list of children */
MemoryContext prevchild; /* previous child of same parent */
Expand Down
1 change: 1 addition & 0 deletions src/postgres/include/nodes/parsenodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ typedef struct TableLikeClause
NodeTag type;
RangeVar *relation;
bits32 options; /* OR of TableLikeOption flags */
Oid relationOid; /* If table has been looked up, its OID */
} TableLikeClause;

typedef enum TableLikeOption
Expand Down
1 change: 1 addition & 0 deletions src/postgres/include/nodes/relation.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ typedef struct IndexOptInfo
bool amhasgettuple; /* does AM have amgettuple interface? */
bool amhasgetbitmap; /* does AM have amgetbitmap interface? */
bool amcanparallel; /* does AM support parallel scan? */
bool amcanmarkpos; /* does AM support mark/restore? */
/* Rather than include amapi.h here, we declare amcostestimate like this */
void (*amcostestimate) (); /* AM's cost estimator */
} IndexOptInfo;
Expand Down
10 changes: 5 additions & 5 deletions src/postgres/include/pg_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@
#define PACKAGE_NAME "PostgreSQL"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "PostgreSQL 10.15"
#define PACKAGE_STRING "PostgreSQL 10.16"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "postgresql"
Expand All @@ -753,7 +753,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "10.15"
#define PACKAGE_VERSION "10.16"

/* Define to the name of a signed 128-bit integer type. */
#define PG_INT128_TYPE __int128
Expand All @@ -772,13 +772,13 @@
#define PG_PRINTF_ATTRIBUTE printf

/* PostgreSQL version as a string */
#define PG_VERSION "10.15"
#define PG_VERSION "10.16"

/* PostgreSQL version as a number */
#define PG_VERSION_NUM 100015
#define PG_VERSION_NUM 100016

/* A string containing the version number, platform, and C compiler */
#define PG_VERSION_STR "PostgreSQL 10.15 on x86_64-apple-darwin19.6.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.28), 64-bit"
#define PG_VERSION_STR "PostgreSQL 10.16 on x86_64-apple-darwin19.6.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.29), 64-bit"

/* Define to 1 to allow profiling output to be saved separately for each
process. */
Expand Down
3 changes: 2 additions & 1 deletion src/postgres/include/postmaster/bgworker_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ extern slist_head BackgroundWorkerList;

extern Size BackgroundWorkerShmemSize(void);
extern void BackgroundWorkerShmemInit(void);
extern void BackgroundWorkerStateChange(void);
extern void BackgroundWorkerStateChange(bool allow_new_workers);
extern void ForgetBackgroundWorker(slist_mutable_iter *cur);
extern void ReportBackgroundWorkerPID(RegisteredBgWorker *);
extern void ReportBackgroundWorkerExit(slist_mutable_iter *cur);
extern void BackgroundWorkerStopNotifications(pid_t pid);
extern void ForgetUnstartedBackgroundWorkers(void);
extern void ResetBackgroundWorkerCrashTimes(void);

/* Function to start a background worker, called from postmaster.c */
Expand Down
17 changes: 9 additions & 8 deletions src/postgres/include/storage/lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ extern bool Debug_deadlocks;

/*
* Top-level transactions are identified by VirtualTransactionIDs comprising
* the BackendId of the backend running the xact, plus a locally-assigned
* LocalTransactionId. These are guaranteed unique over the short term,
* but will be reused after a database restart; hence they should never
* be stored on disk.
* PGPROC fields backendId and lxid. For prepared transactions, the
* LocalTransactionId is an ordinary XID. These are guaranteed unique over
* the short term, but will be reused after a database restart or XID
* wraparound; hence they should never be stored on disk.
*
* Note that struct VirtualTransactionId can not be assumed to be atomically
* assignable as a whole. However, type LocalTransactionId is assumed to
Expand All @@ -62,15 +62,16 @@ extern bool Debug_deadlocks;
*/
typedef struct
{
BackendId backendId; /* determined at backend startup */
LocalTransactionId localTransactionId; /* backend-local transaction id */
BackendId backendId; /* backendId from PGPROC */
LocalTransactionId localTransactionId; /* lxid from PGPROC */
} VirtualTransactionId;

#define InvalidLocalTransactionId 0
#define LocalTransactionIdIsValid(lxid) ((lxid) != InvalidLocalTransactionId)
#define VirtualTransactionIdIsValid(vxid) \
(((vxid).backendId != InvalidBackendId) && \
LocalTransactionIdIsValid((vxid).localTransactionId))
(LocalTransactionIdIsValid((vxid).localTransactionId))
#define VirtualTransactionIdIsPreparedXact(vxid) \
((vxid).backendId == InvalidBackendId)
#define VirtualTransactionIdEquals(vxid1, vxid2) \
((vxid1).backendId == (vxid2).backendId && \
(vxid1).localTransactionId == (vxid2).localTransactionId)
Expand Down
2 changes: 1 addition & 1 deletion src/postgres/include/utils/memutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ GetMemoryChunkContext(void *pointer)
* specific creation routines, and noplace else.
*/
extern MemoryContext MemoryContextCreate(NodeTag tag, Size size,
MemoryContextMethods *methods,
const MemoryContextMethods *methods,
MemoryContext parent,
const char *name);

Expand Down
2 changes: 2 additions & 0 deletions src/postgres/include/utils/timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ extern TimestampTz GetSQLCurrentTimestamp(int32 typmod);
extern Timestamp GetSQLLocalTimestamp(int32 typmod);
extern void TimestampDifference(TimestampTz start_time, TimestampTz stop_time,
long *secs, int *microsecs);
extern long TimestampDifferenceMilliseconds(TimestampTz start_time,
TimestampTz stop_time);
extern bool TimestampDifferenceExceeds(TimestampTz start_time,
TimestampTz stop_time,
int msec);
Expand Down
1 change: 1 addition & 0 deletions src/postgres/src_backend_nodes_copyfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3554,6 +3554,7 @@ _copyTableLikeClause(const TableLikeClause *from)

COPY_NODE_FIELD(relation);
COPY_SCALAR_FIELD(options);
COPY_SCALAR_FIELD(relationOid);

return newnode;
}
Expand Down
1 change: 1 addition & 0 deletions src/postgres/src_backend_nodes_equalfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,7 @@ _equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
{
COMPARE_NODE_FIELD(relation);
COMPARE_SCALAR_FIELD(options);
COMPARE_SCALAR_FIELD(relationOid);

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/postgres/src_backend_nodes_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* - lappend
* - new_list
* - new_tail_cell
* - check_list_invariants
* - lcons
* - new_head_cell
* - list_concat
Expand Down
Loading

0 comments on commit 252cded

Please sign in to comment.