ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
compatibility.c File Reference

Backport implementations for missing PostgreSQL API functions. More...

#include "compatibility.h"
Include dependency graph for compatibility.c:

Go to the source code of this file.

Functions

List * list_insert_nth (List *list, int pos, void *datum)
 Insert datum at position pos in list (PG < 13 backport).
 

Detailed Description

Backport implementations for missing PostgreSQL API functions.

Provides implementations of functions that do not exist in older PostgreSQL versions but are declared in compatibility.h.

Currently provides:

  • list_insert_nth() for PostgreSQL < 13, where the linked-list-based List implementation did not include this helper.

Definition in file compatibility.c.

Function Documentation

◆ list_insert_nth()

List * list_insert_nth ( List *  list,
int  pos,
void *  datum 
)

Insert datum at position pos in list (PG < 13 backport).

PostgreSQL 13 introduced list_insert_nth() when lists were reimplemented as arrays. This declaration provides the same function for older PostgreSQL versions; the implementation lives in compatibility.c.

Parameters
listThe list to insert into (may be NIL).
posZero-based index at which to insert the new element.
datumThe value to insert.
Returns
The (possibly reallocated) list.

Definition at line 15 of file compatibility.c.

Here is the caller graph for this function: