Repository navigation
Releases
Ankus 0.2.38
Ankus 0.2.38 keeps each PgNativeCallback call's 2.8 KB error buffer on the dispatcher's stack. Up to 0.2.37 every call allocated it from TopMemoryContext, and PostgreSQL built with assertions, as ankus init builds it, fills each allocation through RANDOMIZE_ALLOCATED_MEMORY, so there the buffer cost about 26,000 instructions a call. Under callgrind on PostgreSQL 18.7 built that way, the hooks sample's executor-run hook went from 28,083 to 1,491 instructions a statement, and on the PGDG 18 release package from 1,490 to 1,425.
The runtime and compiler packages stay at 10.0.15-ankus.4 and 11.0.0-ankus.4.
To update, run dotnet tool update --global Ankus.Tool --version 0.2.38, then ankus upgrade in your solution.
Ankus 0.2.37
Ankus 0.2.37 makes each PgNativeCallback call cheaper. A hook cost about 0.44 µs a call, so an extension with four executor hooks added close to 2 µs to every statement. An executor-run hook that chains to standard_ExecutorRun now costs about 0.15 µs on a PostgreSQL 18.7 release build on Linux x64, and under callgrind 1,540 instructions where it took 5,450.
The dispatcher no longer zeroes its 2.8 KB error buffer on every call. It clears only the header and field slots, and releases diagnostics only after a call fails. Each generated dispatcher caches the provider that accepted its binding, so it checks the binding again only when the provider changes or something would refuse the call.
The runtime and compiler packages move to 10.0.15-ankus.4 and 11.0.0-ankus.4. Their fork commits record in the child fork handler that a forked process isn't the fork host, so entering and leaving a managed callback reads a flag. glibc doesn't cache the process ID, and a library that PostgreSQL preloads paid two getpid calls on every hook and callback.
To update, run dotnet tool update --global Ankus.Tool --version 0.2.37, then ankus upgrade in your solution.
Ankus 0.2.36
Ankus 0.2.36 generates the last three macros pgrx 0.20.1 generates that had no method in Ankus: GET_STRING_RELOPTION, multi_for_advance_cell and lengthof.
A member that a macro reads through another operand, which pgrx's macros take by name, is now passed by address. GET_STRING_RELOPTION(options, &options->path_offset) reads the string at the offset that member holds, and multi_for_advance_cell(&cell, &state.l1, &state.i1) advances a list cursor, leaving out the state operand the macro reads only members of. An array that a macro measures with its first element takes both types, so lengthof<TArray, TElement>() counts a generated inline array's elements.
Operands passed by address, which a macro dereferences, assigns or reads as a member, now have an overload for every integer width and double, so an int* or short* finds its own method. Dereferenced operands had sbyte*, byte*, long* and ulong*, and assigned ones long*, ulong* and double*. Every earlier method is still generated.
The runtime and compiler packages stay at 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.36, then ankus upgrade in your solution.
Ankus 0.2.35
Ankus 0.2.35 completes the port of pgrx 0.20.1.
On PostgreSQL 15 through 19, NativeMethods has a method for each function-like macro in the selected headers, as pgrx generates a Rust macro for each one. The build types every operand with Clang and runs the macro through a C function compiled against the same headers, so TransactionIdAdvance(&xid), BUFFERALIGN(33) and InHotStandby() work as they do in C. A macro that names a type takes it as a type argument: makeNode<Query>(), IsA<Query>(node), castNode<T>, the lfirst_node family and palloc_object<T>(). The build writes native-macro-report.json with each method's C signature and why any macro has none. Generated node types now carry their own tags for IsA and allocation, and header helpers that touch no C global run on any thread.
PgTsVector, PgTsQuery and PgTsConfig port pgrx's text search types. They carry the bytes PostgreSQL stores and call its own functions for parsing, matching, ranking, combining and ordering. PgDsmLwLock<T> holds a value beside a lightweight lock in a parallel custom scan's dynamic shared memory. ankus migrate assembles unreleased SQL migration fragments into the next upgrade script, and install, run, regress and bench can use them for development. ankus package writes RPM and DEB packages when AnkusRpmPackage or AnkusDebPackage is set.
ankus regress, run and connect no longer give psql a 10-second connect timeout, which pgrx doesn't set. A development cluster's status now waits while a starting or exiting postmaster's PID file is in transition, where it had reported an error.
The runtime and compiler packages stay at 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.35, then ankus upgrade in your solution.
Ankus 0.2.34
Ankus 0.2.34 fixes how a PgDatum read from an SPI row carries a 4-byte unsigned value. Cells of type oid, regclass and xid were rebuilt zero-extended, as ObjectIdGetDatum does, while PostgreSQL's own copy of a 4-byte value is the sign-extended one fetch_att reads, so 4294967295::oid had different bits from a row and from an array. They now rebuild as PostgreSQL copies them. PgHeapTuple.Get<PgDatum> on a dropped attribute now returns null, as pgrx 0.20's safety audit returns None.
PgAlign has PostgreSQL's alignment macros for sizing structures it lays out: TypeAlign, TypeAlignDown and the ShortAlign through BufferAlign forms, with the platform's ALIGNOF_* values. An alignment that isn't a power of two, or a rounding that overflows, throws. The tree walkers and mutators, such as expression_tree_walker and query_tree_mutator, now have PostgreSQL 16's typed callback signatures on every major, so one [PgNativeCallback] implementation serves 13 through 19.
PgBackendThread.IsActive and AssertActive() check that code runs on the backend thread, and PgInterrupts.Check rejects another thread before it reads backend state. PgTransactionId.Max and the new PgMultiXactId match the headers' constants. PgNodes.DangerousIsA and DangerousTryCast<T> take raw node pointers that may be NULL. Generated Ankus.Generated.PgExtensionInfo holds the installed extension version and the package version.
With IncludeTests, the extension test fixture now creates the tests schema itself before CREATE EXTENSION ... CASCADE, so an extension and the extensions it requires can all put test objects there. A report below ERROR can throw when an error context callback raises while formatting it, and the logging guide says so.
The runtime and compiler packages stay at 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.34, then ankus upgrade in your solution.
Ankus 0.2.33
Ankus 0.2.33 moves to PostgreSQL 19.0 and the November minor releases, 14.25, 15.20, 16.16, 17.12 and 18.7, which fix CVE-2026-6460. On those releases PostgreSQL checks that a composite datum still matches its row type before reading it. Typed composite arguments already read through that check, but a raw PgDatum copy of a composite was flattened in a way that marked a datum formed before an upgrade as current. It now goes through the same check, and PgSqlStates.DatumVersionMismatch names the new SQLSTATE 22P07. Native bindings for PostgreSQL 15 through 19 now come from pgrx 0.20.1, and 13 and 14, which pgrx 0.20 dropped, stay on 0.19.3.
ankus regress accepts several test names and runs their matches in command-line order, once each, failing on every name that matches nothing. A -- pgrx-regress-skip pg15 pg16 or -- pgrx-regress-only pg17 pg18 comment in a test skips it by major, as in cargo-pgrx. ankus init now retries the PostgreSQL release list and checksum downloads as it already retried archives.
A rethrown PgException keeps the untranslated message, the domain of its context lines and the errno behind %m, which log hooks read and earlier releases dropped. PgLogLevel gains WarningClientOnly and FatalClientOnly, which report to the client and never to the server log; PostgreSQL 13 rejects the first and only 19 supports the second.
Test servers started by Ankus.Testing now set PGHOST, PGPORT and PGUSER to themselves, as pg_regress's temporary instance does, so a backend that connects by database name, such as a second session or a subscription, reaches the same server. On Windows, stopping a test server now waits for PostgreSQL to close its log, which pg_ctl stop -w can return before, so reading or deleting the log right after disposal no longer fails with a sharing violation.
New test projects take Npgsql from Ankus.Testing and need no reference of their own. Ankus.Testing still accepts Npgsql 10.0.3 and later, so projects created earlier, which pin it, keep building after ankus upgrade.
The runtime and compiler packages stay at 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.33, then ankus upgrade in your solution.
Ankus 0.2.32
Ankus 0.2.32 lets development clusters use PostgreSQL's own log rotation. ankus start and the other commands that run a development server used to write logging_collector = off and log_destination = 'stderr' and reject both settings, so the one log file grew with every start. They now pass both through like any other setting, as cargo pgrx start --postgresql-conf does, so ankus start --postgresql-conf logging_collector=on has PostgreSQL write and rotate its files under the data directory, with current_logfiles naming the current one.
Building an extension also no longer fails when nuget.org is unreachable. Ankus's internal binding project restored with NuGet audit on and warnings as errors, so a build with every package cached still failed with NU1900 when no source could supply vulnerability data. That project restores only SDK packs your own restore already audits, so it no longer audits them again.
The runtime and compiler packages stay at 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.32, then ankus upgrade in your solution.
Ankus 0.2.31
Ankus 0.2.31 makes the Ankus.Testing fixtures recover when PostgreSQL on Windows reads a partial pg_control. On Windows each PostgreSQL server process reads that file again as it starts, without a lock, so a process that starts while another one rewrites it can exit with incorrect checksum in control file. A test cluster could then fail to start, or a connection could close before a test ran. PostgresTestCluster now starts again with a fresh cluster when that ends a startup, within the existing limit of three attempts, and retries a connection up to twice more when its backend exited that way. Other startup and connection failures are still reported at once.
The runtime and compiler packages stay at 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.31, then ankus upgrade in your solution.
Ankus 0.2.30
Ankus 0.2.30 fixes a rare crash where a process that loads an Ankus extension could abort without any message while the extension's embedded .NET runtime was starting. The runtime reads its lock tuning settings the first time two threads compete for a lock, and that can happen while the runtime is still constructing its UTF-8 encoder on the same thread. Reading those settings went through that encoder, once to look up the environment variable on Linux and macOS and once to load the runtime configuration on every platform. The encoder was not ready yet, so the process failed with SIGABRT, or fail-fast status 0xC0000602 on Windows, and wrote nothing. The runtime now reads those settings and its configuration without the encoder.
A new runtime check repeats that race in 200 fresh processes after every Linux and macOS runtime build. The previous runtime failed between a quarter and a half of them on Linux x64 and about 2 in 100 on Windows x64. The corrected runtime passed 10,000 on Linux and 3,000 on Windows. The race was seen on Linux and Windows, and the fix covers macOS, which ran the same code.
The ankus tool now uses System.CommandLine 3.0, so the error for a missing argument names the argument, and NuGet's 8.0 libraries.
The runtime and compiler packages are now 10.0.15-ankus.3 and 11.0.0-ankus.3. To update, run dotnet tool update --global Ankus.Tool --version 0.2.30, then ankus upgrade in your solution, and rebuild and redeploy your extensions. Native AOT embeds the runtime in each published library, so an extension picks up the fix only when it is rebuilt.
Ankus 0.2.29
Ankus 0.2.29 fixes a PostgreSQL server that could fail to start on a busy machine with NativeAOT fork support: host service threads did not detach. when shared_preload_libraries loads an Ankus extension on Linux or macOS. Before the postmaster forks, Ankus's runtime waits for its own service threads, such as a replacement finalizer, to finish. Each of those waits gave up after about 10 seconds, but a new thread on a loaded machine can wait longer than that for its first turn on a CPU. The runtime now waits until the thread finishes, and after 10 seconds, and then every minute, it writes what it is waiting for and each attached thread's ID and role to the server log. The same release fixes a rarer startup hang under server GC with fixed heap counts, where a finalizer exiting during that wait could block on a collection that never ran.
An extension that leaves its own thread running when a preload callback returns now delays startup until that thread ends, with the same report naming it as other. It used to stop the server after about 10 seconds. Finish explicitly created threads before a preload callback returns.
The runtime and compiler packages are now 10.0.15-ankus.2 and 11.0.0-ankus.2. To update, run dotnet tool update --global Ankus.Tool --version 0.2.29, then ankus upgrade in your solution, and rebuild and redeploy your extensions. Native AOT embeds the runtime in each published library, so an extension picks up the fix only when it is rebuilt.