Port snowflake to PostgreSQL 19#40
Conversation
PG19 commit a87987cafca ("Move WAL sequence code into its own file")
split the sequence WAL definitions out of commands/sequence.h into a new
commands/sequence_xlog.h. Include that header on PG19+ so SEQ_MAGIC,
sequence_magic, xl_seq_rec and XLOG_SEQ_LOG keep resolving, and guard the
module's local SEQ_MAGIC/sequence_magic definitions behind the pre-19
version check to avoid duplicate definitions.
Also add an explicit <time.h> include for clock_gettime()/struct timespec.
On PG <=18 <time.h> was pulled in transitively through the backend header
chain, but PG19 header-dependency cleanups (the instr_time.h TSC rework and
removal of the clock_gettime configure probe) pruned that path, so without
the include PG19 fails with "call to undeclared function 'clock_gettime'".
Following the "include what you use" rule, add it directly; it is harmless
on all supported branches.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Summary
Adapts the
snowflakeextension to build against PostgreSQL 19, tracking two upstream changes in the PG19 development cycle. All changes are guarded byPG_VERSION_NUMso the module continues to compile on PG ≤18.Changes
1. Sequence WAL definitions moved to a new header
PG19 commit
a87987cafca("Move WAL sequence code into its own file") split the sequence WAL definitions out ofcommands/sequence.hinto a newcommands/sequence_xlog.h. The symbolsSEQ_MAGIC,sequence_magic,xl_seq_recandXLOG_SEQ_LOG— all used bysnowflake_nextval()andread_seq_tuple()— now live there.commands/sequence_xlog.hon PG19+ (guarded, since the header does not exist on earlier branches).SEQ_MAGICdefine andsequence_magicstruct behind#if PG_VERSION_NUM < 190000, so on PG19 they resolve solely from the upstream header and there is no duplicate-definition conflict. On ≤18 the header never exported them, so the local definitions are still required.2.
<time.h>no longer reached transitivelysnowflake_nextval()callsclock_gettime(CLOCK_REALTIME, ...). On PG ≤18 the system<time.h>was pulled in transitively through the backend header chain; PG19 header-dependency cleanups (theinstr_time.hTSC rework and removal of theclock_gettimeconfigure probe) removed that path. Verified: without the include, PG19 fails withcall to undeclared function 'clock_gettime'/undeclared identifier 'CLOCK_REALTIME', and no other included header provides the declaration.Added an explicit
#include <time.h>— the standard "include what you use" fix, applied unconditionally as it is harmless on all supported branches.