Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0c5a3a6
Mark pg_prewarm as a trusted extension
MMeent Jul 30, 2024
094c96a
NEON: Fix BRIN redo in PS' WAL-redo process
MMeent Jul 30, 2024
524a0bc
NEON: Replace tuple INSERT/UPDATE/DELETE records with custom ones
MMeent Jul 30, 2024
9e737ae
NEON: Update Sequence logging to 0 (from 32)
MMeent Jul 30, 2024
d186810
NEON: Allow the user to specify a cluster ID in initdb
MMeent Jul 31, 2024
9ac839b
NEON: Add a LwLsnCache hooks to keep track of recent smgr-level changes
MMeent Jul 31, 2024
5cad471
Neon: Wrap darwin.h's USE_PREFETCH with ifndef USE_PREFETCH
MMeent Jun 27, 2025
fa0f2be
NEON: Expose lag tracker, CHECK_FOR_INTERRUPTS, add backpressure
MMeent Jul 31, 2024
37ab94b
NEON: WalRedo & startup process compatibility
MMeent Jul 31, 2024
39a71d5
NEON: Add prefetching to various scan types
MMeent Jul 31, 2024
e7bd866
NEON: Extend EXPLAIN with options for LFC and Prefetch IO metrics
MMeent Jul 31, 2024
0c9b671
NEON: Adjust visibilitymap_set to always log hint bits
MMeent Jul 31, 2024
6000327
NEON: Allow privileged roles to use some administrative commands
MMeent Jul 3, 2025
9c5a6b0
NEON: Add efficient 'new page' support in XLogRecordAssemble
MMeent Jul 3, 2025
78c4718
NEON: WAL-log various files' state changes
MMeent Jul 3, 2025
07f0aa6
Make logical apply worker take into account syncrep flush position.
arssher Aug 21, 2024
b0a2bf0
NEON: Add hooks to allow on-demand WAL download
Aug 21, 2024
4bfa2a1
Use smgrexists() to enforce uniqueness of generated relfilenumber
knizhnik Aug 21, 2024
63757c7
Remove assertion. TODO figure out why and add a comment
lubennikovaav Aug 8, 2024
879b07a
fix wal-redo buffer management
lubennikovaav Aug 9, 2024
68a01af
Add new GUC disable_logical_replication_subscribers (#567)
lubennikovaav Jan 22, 2025
5f7b1c8
Avoid runtime failure in CopyXLogRecordToWAL with sanitizers (cf. 46a…
alexanderlaw Jan 29, 2025
4ac2a9f
Add --save-records option to pg_waldump
Feb 1, 2025
4e8f063
Persist pg_stat file using AUX mechanism
Oct 2, 2024
6242c42
Skip dropping tablesync replication slots on the publisher (#594)
lubennikovaav Mar 4, 2025
3006ef1
NEON: Add option to skip event triggers in pg_dump
piercypixel May 1, 2025
da4d53d
NEON: Dynamic installation of extension's libraries.
MMeent Jul 30, 2024
ada2408
NEON: Add relpersistence to SMgrRelation and smgropen
MMeent Jul 4, 2025
21eebb4
NEON: Move f_smgr typedef into smgr.h from smgr.c
MMeent Jul 4, 2025
3e55b05
NEON: Allow registering new SMgrs
MMeent Jul 7, 2025
75ce7df
NEON: Add smgr hooks for 2-phase relation builds
MMeent Jul 7, 2025
45dc835
NEON: Add hook in smgr to allow on-demand SLRU segment download
MMeent Jul 8, 2025
9321993
NEON: Add #define to distinguish between vanilla PG and Neon's fork
MMeent Jul 8, 2025
8f0b228
NEON: Add dbsize hook, allowing efficient database size calculations.
MMeent Jul 8, 2025
f3a2f1e
NEON: Add alternative tablespace_1.out
MMeent Jul 8, 2025
3cc313c
NEON: Add Neon's 2 new boot modes to the Postgres binary
MMeent Jul 8, 2025
d1ed4ad
NEON: Allow background workers to be handled as WAL Sender process
MMeent Jul 8, 2025
74c1079
NEON: Mark as custom "Neon Postgres" ABI
MMeent Jul 8, 2025
494e00e
NEON: Add --with-libseccomp configure option
MMeent Jul 8, 2025
de23123
NEON: Expose WalSndWaitForWal for use in Neon's walproposer
MMeent Jul 8, 2025
0eecd49
NEON: Allow HOT replica to continue replay after GUC mismatches
Sep 19, 2024
211af09
NEON: Add a databricks auth hook
dimitri Jul 16, 2025
82f85f0
NEON: Stash work to make PG18 work well enough
MMeent Jul 23, 2025
8a73efb
NEON: Only allocate and use the buffer for SLRU segment with the old
iddm Jul 16, 2025
db361c1
pg hooks for online table (#693)
dimitri Jul 18, 2025
1fa9817
Reintialize page in allocNewBuffer only when buffer is returned
Jun 30, 2025
dbfab16
Add a CI build to check postgres repository changes.
dimitri Jul 25, 2025
73c4b6f
Fix some compiler warnings
Aug 5, 2025
819ea4d
Fix issue in FinishWalRecovery with NeonRecoveryRequested
Aug 5, 2025
d6cecdf
update hook type to be in-line with hadron #1580
thesuhas Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Postgres

on:
push:
branches:
- REL_18_STABLE_neon
pull_request:
branches:
- REL_18_STABLE_neon

jobs:
build_postgres:
name: Build Postgres
runs-on: ubuntu-latest
steps:
- name: Install Postgres Build Dependencies
run: |
sudo apt-get install build-essential coreutils libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libxml2-utils xsltproc git

- name: Install Neon Build Dependencies
run: |
sudo apt install libtool libseccomp-dev clang pkg-config cmake postgresql-client protobuf-compiler libprotobuf-dev libcurl4-openssl-dev openssl libicu-dev

- name: Checkout Neon main branch
run: |
git clone https://github.com/neondatabase/neon ./neon

- name: Checkout postgres repository
uses: actions/checkout@v4
with:
path: './neon/vendor/postgres-v18'

- name: Build PostgreSQL and Neon Extension
run: |
make -s -j`nproc` -C ./neon -s neon-pg-ext-v18

- name: Run PostgreSQL Test Suite
run: |
make -s -j`nproc` -C ./neon/build/v18 check

- name: Append Postgres binaries to the PATH
run: |
echo "./neon/pg_install/v18/bin" >> "$GITHUB_PATH"

- name: Start Postgres
run: |
pg_ctl init --pgdata ./data
pg_ctl start --pgdata ./data -o '-c shared_preload_libraries=neon'

- name: Create Extension Neon
env:
PGHOST: /tmp
PGDATABASE: postgres
run: |
psql --echo-queries --command 'create extension neon;'

- name: Stop Postgres
run: |
pg_ctl stop --pgdata ./data
87 changes: 87 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ LIBURING_CFLAGS
with_liburing
with_readline
with_systemd
with_libseccomp
with_selinux
with_ldap
with_krb_srvnam
Expand Down Expand Up @@ -871,6 +872,7 @@ with_bsd_auth
with_ldap
with_bonjour
with_selinux
with_libseccomp
with_systemd
with_readline
with_libedit_preferred
Expand Down Expand Up @@ -1589,6 +1591,7 @@ Optional Packages:
--with-ldap build with LDAP support
--with-bonjour build with Bonjour support
--with-selinux build with SELinux support
--with-libseccomp build with libseccomp support
--with-systemd build with systemd support
--without-readline do not use GNU Readline nor BSD Libedit for editing
--with-libedit-preferred
Expand Down Expand Up @@ -8614,6 +8617,39 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
$as_echo "$with_selinux" >&6; }

#
# libseccomp
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with libseccomp support" >&5
$as_echo_n "checking whether to build with libseccomp support... " >&6; }



# Check whether --with-libseccomp was given.
if test "${with_libseccomp+set}" = set; then :
withval=$with_libseccomp;
case $withval in
yes)
:
;;
no)
:
;;
*)
as_fn_error $? "no argument expected for --with-libseccomp option" "$LINENO" 5
;;
esac

else
with_libseccomp=no

fi



{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libseccomp" >&5
$as_echo "$with_libseccomp" >&6; }

#
# Systemd
#
Expand Down Expand Up @@ -13661,6 +13697,57 @@ else
as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
fi


fi

if test "$with_libseccomp" = yes ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for seccomp_init in -lseccomp" >&5
$as_echo_n "checking for seccomp_init in -lseccomp... " >&6; }
if ${ac_cv_lib_seccomp_seccomp_init+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lseccomp $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char seccomp_init ();
int
main ()
{
return seccomp_init ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_seccomp_seccomp_init=yes
else
ac_cv_lib_seccomp_seccomp_init=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_seccomp_seccomp_init" >&5
$as_echo "$ac_cv_lib_seccomp_seccomp_init" >&6; }
if test "x$ac_cv_lib_seccomp_seccomp_init" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSECCOMP 1
_ACEOF

LIBS="-lseccomp $LIBS"

else
as_fn_error $? "library 'libseccomp' is required for Seccomp BPF support" "$LINENO" 5
fi

fi

# for contrib/uuid-ossp
Expand Down
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,14 @@ PGAC_ARG_BOOL(with, selinux, no, [build with SELinux support])
AC_SUBST(with_selinux)
AC_MSG_RESULT([$with_selinux])

#
# libseccomp
#
AC_MSG_CHECKING([whether to build with libseccomp support])
PGAC_ARG_BOOL(with, libseccomp, no, [build with libseccomp support])
AC_SUBST(with_libseccomp)
AC_MSG_RESULT([$with_libseccomp])

#
# Systemd
#
Expand Down Expand Up @@ -1638,6 +1646,11 @@ dnl If you want to use Apple's own Bonjour code on another platform,
dnl just add -ldns_sd to LIBS manually.
fi

if test "$with_libseccomp" = yes ; then
AC_CHECK_LIB(seccomp, seccomp_init, [],
[AC_MSG_ERROR([library 'libseccomp' is required for Seccomp BPF support])])
fi

# for contrib/uuid-ossp
if test "$with_uuid" = bsd ; then
AC_CHECK_HEADERS(uuid.h,
Expand Down
1 change: 1 addition & 0 deletions contrib/pg_prewarm/pg_prewarm.control
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ comment = 'prewarm relation data'
default_version = '1.2'
module_pathname = '$libdir/pg_prewarm'
relocatable = true
trusted = true
9 changes: 9 additions & 0 deletions doc/src/sgml/ref/pg_dump.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,15 @@ PostgreSQL documentation
</listitem>
</varlistentry>

<varlistentry>
<term><option>--no-event-triggers</option></term>
<listitem>
<para>
Do not dump event triggers.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>--no-sync</option></term>
<listitem>
Expand Down
9 changes: 9 additions & 0 deletions doc/src/sgml/ref/pg_dumpall.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,15 @@ exclude database <replaceable class="parameter">PATTERN</replaceable>
</listitem>
</varlistentry>

<varlistentry>
<term><option>--no-event-triggers</option></term>
<listitem>
<para>
Do not dump event triggers.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>--no-sync</option></term>
<listitem>
Expand Down
10 changes: 10 additions & 0 deletions doc/src/sgml/ref/pg_restore.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,16 @@ PostgreSQL documentation
</listitem>
</varlistentry>

<varlistentry>
<term><option>--no-event-triggers</option></term>
<listitem>
<para>
Do not output commands to restore event triggers, even if the archive
contains them.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>--no-table-access-method</option></term>
<listitem>
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.global.in
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ with_tcl = @with_tcl@
with_ssl = @with_ssl@
with_readline = @with_readline@
with_selinux = @with_selinux@
with_libseccomp = @with_libseccomp@
with_systemd = @with_systemd@
with_gssapi = @with_gssapi@
with_krb_srvnam = @with_krb_srvnam@
Expand Down
3 changes: 2 additions & 1 deletion src/backend/access/brin/brin_xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ brin_xlog_insert_update(XLogReaderState *record,
}

/* need this page's blkno to store in revmap */
regpgno = BufferGetBlockNumber(buffer);
/* NEON XXX Don't use BufferGetBlockNumber because wal-redo doesn't pin buffer. */
XLogRecGetBlockTag(record, 0, NULL, NULL, &regpgno);

/* insert the index item into the page */
if (action == BLK_NEEDS_REDO)
Expand Down
6 changes: 6 additions & 0 deletions src/backend/access/gin/gininsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ ginbuild(Relation heap, Relation index, IndexInfo *indexInfo)
elog(ERROR, "index \"%s\" already contains data",
RelationGetRelationName(index));

smgr_start_unlogged_build(RelationGetSmgr(index));

initGinState(&buildstate.ginstate, index);
buildstate.indtuples = 0;
memset(&buildstate.buildStats, 0, sizeof(GinStatsData));
Expand Down Expand Up @@ -746,6 +748,8 @@ ginbuild(Relation heap, Relation index, IndexInfo *indexInfo)
buildstate.buildStats.nTotalPages = RelationGetNumberOfBlocks(index);
ginUpdateStats(index, &buildstate.buildStats, true);

smgr_finish_unlogged_build_phase_1(RelationGetSmgr(index));

/*
* We didn't write WAL records as we built the index, so if WAL-logging is
* required, write all pages to the WAL now.
Expand All @@ -757,6 +761,8 @@ ginbuild(Relation heap, Relation index, IndexInfo *indexInfo)
true);
}

smgr_end_unlogged_build(RelationGetSmgr(index));

/*
* Return statistics
*/
Expand Down
25 changes: 17 additions & 8 deletions src/backend/access/gin/ginxlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ ginRedoSplit(XLogReaderState *record)
rootbuf;
bool isLeaf = (data->flags & GIN_INSERT_ISLEAF) != 0;
bool isRoot = (data->flags & GIN_SPLIT_ROOT) != 0;
XLogRedoAction action;

/*
* First clear incomplete-split flag on child page if this finishes a
Expand All @@ -415,21 +416,27 @@ ginRedoSplit(XLogReaderState *record)
if (!isLeaf)
ginRedoClearIncompleteSplit(record, 3);

if (XLogReadBufferForRedo(record, 0, &lbuffer) != BLK_RESTORED)
action = XLogReadBufferForRedo(record, 0, &lbuffer);
if (action != BLK_RESTORED && action != BLK_DONE)
elog(ERROR, "GIN split record did not contain a full-page image of left page");

if (XLogReadBufferForRedo(record, 1, &rbuffer) != BLK_RESTORED)
action = XLogReadBufferForRedo(record, 1, &rbuffer);
if (action != BLK_RESTORED && action != BLK_DONE)
elog(ERROR, "GIN split record did not contain a full-page image of right page");

if (isRoot)
{
if (XLogReadBufferForRedo(record, 2, &rootbuf) != BLK_RESTORED)
action = XLogReadBufferForRedo(record, 2, &rootbuf);
if (action != BLK_RESTORED && action != BLK_DONE)
elog(ERROR, "GIN split record did not contain a full-page image of root page");
UnlockReleaseBuffer(rootbuf);
if (rootbuf != InvalidBuffer)
UnlockReleaseBuffer(rootbuf);
}

UnlockReleaseBuffer(rbuffer);
UnlockReleaseBuffer(lbuffer);
if (rbuffer != InvalidBuffer)
UnlockReleaseBuffer(rbuffer);
if (lbuffer != InvalidBuffer)
UnlockReleaseBuffer(lbuffer);
}

/*
Expand All @@ -443,9 +450,11 @@ ginRedoVacuumPage(XLogReaderState *record)

if (XLogReadBufferForRedo(record, 0, &buffer) != BLK_RESTORED)
{
elog(ERROR, "replay of gin entry tree page vacuum did not restore the page");
/* NEON: we do not not apply WAL record if target page is absent at replica */
elog(DEBUG2, "replay of gin entry tree page vacuum did not restore the page");
}
UnlockReleaseBuffer(buffer);
if (BufferIsValid(buffer))
UnlockReleaseBuffer(buffer);
}

static void
Expand Down
Loading
Loading