Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
71c1136
Fix mistakes in commit 4020b370f214315b8c10430301898ac21658143f
robertmhaas Jan 29, 2026
ec31744
Replace literal 0 with InvalidXLogRecPtr for XLogRecPtr assignments
alvherre Jan 29, 2026
de90bb7
Fix theoretical memory leaks in pg_locale_libc.c.
jeff-davis Jan 29, 2026
bd9dfac
Further fix extended alignment for older g++.
tglsfdc Jan 29, 2026
333f586
bufmgr: Allow conditionally locking of already locked buffer
anarazel Jan 29, 2026
87f7b82
tableam: Perform CheckXidAlive check once per scan
anarazel Jan 29, 2026
bb26a81
Remove unused argument from ApplyLogicalMappingFile().
MasaoFujii Jan 30, 2026
1eb09ed
Use C99 designated designators in a couple of places
alvherre Jan 30, 2026
e76221b
Minor cosmetic tweaks
alvherre Jan 30, 2026
e2362eb
Move shmem allocator's fields from PGShmemHeader to its own struct
hlinnaka Jan 30, 2026
a1d7ae2
Improve guards against false regex matches in BackgroundPsql.pm.
tglsfdc Jan 30, 2026
6918434
Make psql/t/030_pager.pl more robust.
tglsfdc Jan 30, 2026
d46aa32
Fix build inconsistency due to the generation of wait-event code
michaelpq Feb 1, 2026
a9afa02
Fix error message in RemoveWalSummaryIfOlderThan()
michaelpq Feb 2, 2026
0c9f46c
In s_lock.h, use regular labels with %= instead of local labels.
tglsfdc Feb 2, 2026
da7a1dc
Refactor att_align_nominal() to improve performance.
tglsfdc Feb 2, 2026
12451d9
test_shm_mq: Set background worker names.
nathan-bossart Feb 2, 2026
4a99ef1
Fix flakiness in the pg_visibility VM-only vacuum test by using a tem…
melanieplageman Feb 2, 2026
dddbbc2
psql: Add %i prompt escape to indicate hot standby status.
MasaoFujii Feb 3, 2026
21c1125
Release synchronous replication waiters immediately on configuration …
MasaoFujii Feb 3, 2026
213fec2
Fix incorrect errno in OpenWalSummaryFile()
michaelpq Feb 3, 2026
e05a24c
Add two IO wait events for COPY FROM/TO on a pipe/file/program
michaelpq Feb 3, 2026
137d05d
Rename AssertVariableIsOfType to StaticAssertVariableIsOfType
petere Feb 3, 2026
955e507
Change StaticAssertVariableIsOfType to be a declaration
petere Feb 3, 2026
96e2af6
Reject ADD CONSTRAINT NOT NULL if name mismatches existing constraint
alvherre Feb 3, 2026
cd375d5
Remove useless errdetail_abort()
hlinnaka Feb 3, 2026
57bff90
Don't hint that you can reconnect when the database is dropped
hlinnaka Feb 3, 2026
78bf28e
Docs: consolidate dependency notes in pg_dump and pg_restore
alvherre Feb 3, 2026
c8ec747
pg_resetwal: Fix incorrect error message related to pg_wal/summaries/
michaelpq Feb 4, 2026
4cfce4e
Change copyObject() to use typeof_unqual
petere Feb 4, 2026
084e42b
Add backendType to PGPROC, replacing isRegularBackend
hlinnaka Feb 4, 2026
176dffd
Fix various instances of undefined behavior
j-naylor Feb 4, 2026
36ead71
Fix logical replication TAP test to read publisher log correctly.
MasaoFujii Feb 4, 2026
0c8e082
Assign "backend" type earlier during process start-up
alvherre Feb 4, 2026
3c5ec35
oid2name: Add relation path to the information provided by -x/--extended
michaelpq Feb 5, 2026
7a1f0f8
pg_upgrade: Optimize logical replication slot caught-up check.
MasahikoSawada Feb 5, 2026
9476ef2
Fix comment in extended_stats_funcs.c
michaelpq Feb 5, 2026
e35add4
doc: Move synchronized_standby_slots to "Primary Server" section.
MasaoFujii Feb 6, 2026
f94e914
Add file_extend_method=posix_fallocate,write_zeros.
macdice May 31, 2025
74a116a
Fix some error message inconsistencies
michaelpq Feb 6, 2026
072c842
Fix use of proc number in pgstat_create_backend()
michaelpq Feb 6, 2026
e3d3785
doc: Expand upon protocol versions and extensions
jchampio Feb 6, 2026
d8d7c5d
libpq: Prepare for protocol grease during 19beta
jchampio Feb 6, 2026
ba1e141
Adjust style of some debugging macros.
nathan-bossart Feb 6, 2026
7cdb633
Make some minor cleanups in typalign-related code.
tglsfdc Feb 7, 2026
0af05b5
Revert "Change copyObject() to use typeof_unqual"
petere Feb 7, 2026
7467041
Future-proof sort template against undefined behavior
j-naylor Feb 7, 2026
1653ce5
Further error message fix
petere Feb 7, 2026
c0bf157
meson: host_system value for Solaris is 'sunos' not 'solaris'.
tglsfdc Feb 8, 2026
73dd716
Replace some hard-wired OID constants with corresponding macros.
tglsfdc Feb 8, 2026
379695d
pgcrypto: Fix buffer overflow in pgp_pub_decrypt_bytea()
michaelpq Feb 8, 2026
5459867
Remove 'charlen' argument from make_trigrams()
hlinnaka Jan 20, 2026
00896dd
Fix buffer overflows in pg_trgm due to lower-casing
hlinnaka Jan 20, 2026
af79c30
Fix encoding length for EUC_CN.
macdice Feb 4, 2026
74ee636
Fix mb2wchar functions on short input.
macdice Jan 25, 2026
1e7fe06
Replace pg_mblen() with bounds-checked versions.
macdice Jan 7, 2026
c67bef3
Code coverage for most pg_mblen* calls.
macdice Jan 11, 2026
38e0190
Allow log_min_messages to be set per process type
alvherre Feb 9, 2026
d536aee
Require PGP-decrypted text to pass encoding validation.
nmisch Feb 9, 2026
60e7ae4
Guard against unexpected dimensions of oidvector/int2vector.
tglsfdc Feb 9, 2026
841d42c
Require superuser to install a non-built-in selectivity estimator.
tglsfdc Feb 9, 2026
8ebdf41
Harden _int_matchsel() against being attached to the wrong operator.
tglsfdc Feb 9, 2026
c5dc754
Fix test "NUL byte in text decrypt" for --without-zlib builds.
nmisch Feb 9, 2026
18f0afb
Fix incorrect iteration type in extension_file_exists()
hlinnaka Feb 9, 2026
cbef472
Remove HeapTupleheaderSetXminCommitted/Invalid functions
alvherre Feb 9, 2026
73d60ac
cleanup: Deadlock checker is no longer called from signal handler
hlinnaka Feb 9, 2026
158408f
pg_upgrade: Fix handling of pg_largeobject_metadata.
nathan-bossart Feb 9, 2026
0a37961
Optimize IS DISTINCT FROM with non-nullable inputs
Feb 10, 2026
0aaf0de
Optimize BooleanTest with non-nullable input
Feb 10, 2026
f41ab51
Teach planner to transform "x IS [NOT] DISTINCT FROM NULL" to a NullTest
Feb 10, 2026
307447e
Add information about range type stats to pg_stats_ext_exprs
michaelpq Feb 10, 2026
f33c585
Simplify some log messages in extended_stats_funcs.c
michaelpq Feb 10, 2026
ddc3250
Use ProcNumber rather than pid in ReplicationSlot
hlinnaka Feb 10, 2026
17f51ea
Separate RecoveryConflictReasons from procsignals
hlinnaka Feb 10, 2026
be52577
Refactor ProcessRecoveryConflictInterrupt for readability
hlinnaka Feb 10, 2026
87eed64
Fix PGS_CONSIDER_NONPARTIAL interaction with Materialize nodes.
robertmhaas Feb 3, 2026
e1d5d2e
Pass cursorOptions to planner_setup_hook.
robertmhaas Jan 28, 2026
7011945
Store information about range-table flattening in the final plan.
robertmhaas Oct 20, 2025
c2aba78
Store information about elided nodes in the final plan.
robertmhaas Oct 20, 2025
1cd6d8d
Store information about Append node consolidation in the final plan.
robertmhaas Jan 12, 2026
f51fee2
Allow extensions to mark an individual index as disabled.
robertmhaas Feb 7, 2026
3a4f373
Add pg_plan_advice contrib module.
robertmhaas Jan 26, 2026
d320a8a
Fix add_partial_path interaction with disabled_nodes
robertmhaas Feb 5, 2026
817ac0b
Consider startup cost as a figure of merit for partial paths.
robertmhaas Feb 6, 2026
03d9151
Test pg_plan_advice using a new test_plan_advice module.
robertmhaas Feb 7, 2026
e5429e7
add pg_plan_advice.feedback_warnings
robertmhaas Feb 9, 2026
53c6f8a
use get_namespace_name_or_temp, not get_namespace_name
robertmhaas Feb 9, 2026
b46a49e
Fix NO_GATHER filtering for scans with multiple RTIs.
robertmhaas Feb 9, 2026
e740bb7
comment cleanup
robertmhaas Feb 10, 2026
5649c94
make sure PARTITIONWISE((x y)) doesn't conflict with JOIN_ORDER(...{x…
robertmhaas Feb 10, 2026
f4f3bfa
pgindent cleanup for pg_plan_advice
robertmhaas Feb 10, 2026
543385a
doc changes
robertmhaas Feb 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions contrib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SUBDIRS = \
pg_freespacemap \
pg_logicalinspect \
pg_overexplain \
pg_plan_advice \
pg_prewarm \
pg_stat_statements \
pg_surgery \
Expand Down
21 changes: 16 additions & 5 deletions contrib/btree_gist/btree_utils_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,36 +115,47 @@ gbt_var_leaf2node(GBT_VARKEY *leaf, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)

/*
* returns the common prefix length of a node key
*
* If the underlying type is character data, the prefix length may point in
* the middle of a multibyte character.
*/
static int32
gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
{
GBT_VARKEY_R r = gbt_var_key_readable(node);
int32 i = 0;
int32 l = 0;
int32 l_left_to_match = 0;
int32 l_total = 0;
int32 t1len = VARSIZE(r.lower) - VARHDRSZ;
int32 t2len = VARSIZE(r.upper) - VARHDRSZ;
int32 ml = Min(t1len, t2len);
char *p1 = VARDATA(r.lower);
char *p2 = VARDATA(r.upper);
const char *end1 = p1 + t1len;
const char *end2 = p2 + t2len;

if (ml == 0)
return 0;

while (i < ml)
{
if (tinfo->eml > 1 && l == 0)
if (tinfo->eml > 1 && l_left_to_match == 0)
{
if ((l = pg_mblen(p1)) != pg_mblen(p2))
l_total = pg_mblen_range(p1, end1);
if (l_total != pg_mblen_range(p2, end2))
{
return i;
}
l_left_to_match = l_total;
}
if (*p1 != *p2)
{
if (tinfo->eml > 1)
{
return (i - l + 1);
int32 l_matched_subset = l_total - l_left_to_match;

/* end common prefix at final byte of last matching char */
return i - l_matched_subset;
}
else
{
Expand All @@ -154,7 +165,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)

p1++;
p2++;
l--;
l_left_to_match--;
i++;
}
return ml; /* lower == upper */
Expand Down
4 changes: 3 additions & 1 deletion contrib/dblink/dblink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,7 @@ get_text_array_contents(ArrayType *array, int *numitems)
int16 typlen;
bool typbyval;
char typalign;
uint8 typalignby;
char **values;
char *ptr;
bits8 *bitmap;
Expand All @@ -2081,6 +2082,7 @@ get_text_array_contents(ArrayType *array, int *numitems)

get_typlenbyvalalign(ARR_ELEMTYPE(array),
&typlen, &typbyval, &typalign);
typalignby = typalign_to_alignby(typalign);

values = palloc_array(char *, nitems);

Expand All @@ -2098,7 +2100,7 @@ get_text_array_contents(ArrayType *array, int *numitems)
{
values[i] = TextDatumGetCString(PointerGetDatum(ptr));
ptr = att_addlength_pointer(ptr, typlen, ptr);
ptr = (char *) att_align_nominal(ptr, typalign);
ptr = (char *) att_nominal_alignby(ptr, typalignby);
}

/* advance bitmap pointer if any */
Expand Down
4 changes: 2 additions & 2 deletions contrib/dict_xsyn/dict_xsyn.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ find_word(char *in, char **end)

*end = NULL;
while (*in && isspace((unsigned char) *in))
in += pg_mblen(in);
in += pg_mblen_cstr(in);

if (!*in || *in == '#')
return NULL;
start = in;

while (*in && !isspace((unsigned char) *in))
in += pg_mblen(in);
in += pg_mblen_cstr(in);

*end = in;

Expand Down
2 changes: 1 addition & 1 deletion contrib/hstore/hstore_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ prssyntaxerror(HSParser *state)
errsave(state->escontext,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error in hstore, near \"%.*s\" at position %d",
pg_mblen(state->ptr), state->ptr,
pg_mblen_cstr(state->ptr), state->ptr,
(int) (state->ptr - state->begin))));
/* In soft error situation, return false as convenience for caller */
return false;
Expand Down
13 changes: 7 additions & 6 deletions contrib/hstore_plperl/hstore_plperl.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,32 @@ static hstoreCheckKeyLen_t hstoreCheckKeyLen_p;
typedef size_t (*hstoreCheckValLen_t) (size_t len);
static hstoreCheckValLen_t hstoreCheckValLen_p;

/* Static asserts verify that typedefs above match original declarations */
StaticAssertVariableIsOfType(&hstoreUpgrade, hstoreUpgrade_t);
StaticAssertVariableIsOfType(&hstoreUniquePairs, hstoreUniquePairs_t);
StaticAssertVariableIsOfType(&hstorePairs, hstorePairs_t);
StaticAssertVariableIsOfType(&hstoreCheckKeyLen, hstoreCheckKeyLen_t);
StaticAssertVariableIsOfType(&hstoreCheckValLen, hstoreCheckValLen_t);


/*
* Module initialize function: fetch function pointers for cross-module calls.
*/
void
_PG_init(void)
{
/* Asserts verify that typedefs above match original declarations */
AssertVariableIsOfType(&hstoreUpgrade, hstoreUpgrade_t);
hstoreUpgrade_p = (hstoreUpgrade_t)
load_external_function("$libdir/hstore", "hstoreUpgrade",
true, NULL);
AssertVariableIsOfType(&hstoreUniquePairs, hstoreUniquePairs_t);
hstoreUniquePairs_p = (hstoreUniquePairs_t)
load_external_function("$libdir/hstore", "hstoreUniquePairs",
true, NULL);
AssertVariableIsOfType(&hstorePairs, hstorePairs_t);
hstorePairs_p = (hstorePairs_t)
load_external_function("$libdir/hstore", "hstorePairs",
true, NULL);
AssertVariableIsOfType(&hstoreCheckKeyLen, hstoreCheckKeyLen_t);
hstoreCheckKeyLen_p = (hstoreCheckKeyLen_t)
load_external_function("$libdir/hstore", "hstoreCheckKeyLen",
true, NULL);
AssertVariableIsOfType(&hstoreCheckValLen, hstoreCheckValLen_t);
hstoreCheckValLen_p = (hstoreCheckValLen_t)
load_external_function("$libdir/hstore", "hstoreCheckValLen",
true, NULL);
Expand Down
17 changes: 9 additions & 8 deletions contrib/hstore_plpython/hstore_plpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,40 @@ static hstoreCheckKeyLen_t hstoreCheckKeyLen_p;
typedef size_t (*hstoreCheckValLen_t) (size_t len);
static hstoreCheckValLen_t hstoreCheckValLen_p;

/* Static asserts verify that typedefs above match original declarations */
StaticAssertVariableIsOfType(&PLyObject_AsString, PLyObject_AsString_t);
StaticAssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
StaticAssertVariableIsOfType(&hstoreUpgrade, hstoreUpgrade_t);
StaticAssertVariableIsOfType(&hstoreUniquePairs, hstoreUniquePairs_t);
StaticAssertVariableIsOfType(&hstorePairs, hstorePairs_t);
StaticAssertVariableIsOfType(&hstoreCheckKeyLen, hstoreCheckKeyLen_t);
StaticAssertVariableIsOfType(&hstoreCheckValLen, hstoreCheckValLen_t);


/*
* Module initialize function: fetch function pointers for cross-module calls.
*/
void
_PG_init(void)
{
/* Asserts verify that typedefs above match original declarations */
AssertVariableIsOfType(&PLyObject_AsString, PLyObject_AsString_t);
PLyObject_AsString_p = (PLyObject_AsString_t)
load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyObject_AsString",
true, NULL);
AssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
PLyUnicode_FromStringAndSize_p = (PLyUnicode_FromStringAndSize_t)
load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyUnicode_FromStringAndSize",
true, NULL);
AssertVariableIsOfType(&hstoreUpgrade, hstoreUpgrade_t);
hstoreUpgrade_p = (hstoreUpgrade_t)
load_external_function("$libdir/hstore", "hstoreUpgrade",
true, NULL);
AssertVariableIsOfType(&hstoreUniquePairs, hstoreUniquePairs_t);
hstoreUniquePairs_p = (hstoreUniquePairs_t)
load_external_function("$libdir/hstore", "hstoreUniquePairs",
true, NULL);
AssertVariableIsOfType(&hstorePairs, hstorePairs_t);
hstorePairs_p = (hstorePairs_t)
load_external_function("$libdir/hstore", "hstorePairs",
true, NULL);
AssertVariableIsOfType(&hstoreCheckKeyLen, hstoreCheckKeyLen_t);
hstoreCheckKeyLen_p = (hstoreCheckKeyLen_t)
load_external_function("$libdir/hstore", "hstoreCheckKeyLen",
true, NULL);
AssertVariableIsOfType(&hstoreCheckValLen, hstoreCheckValLen_t);
hstoreCheckValLen_p = (hstoreCheckValLen_t)
load_external_function("$libdir/hstore", "hstoreCheckValLen",
true, NULL);
Expand Down
14 changes: 13 additions & 1 deletion contrib/intarray/_int_selfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "catalog/pg_operator.h"
#include "catalog/pg_statistic.h"
#include "catalog/pg_type.h"
#include "commands/extension.h"
#include "miscadmin.h"
#include "utils/fmgrprotos.h"
#include "utils/lsyscache.h"
Expand Down Expand Up @@ -170,7 +171,18 @@ _int_matchsel(PG_FUNCTION_ARGS)
PG_RETURN_FLOAT8(0.0);
}

/* The caller made sure the const is a query, so get it now */
/*
* Verify that the Const is a query_int, else return a default estimate.
* (This could only fail if someone attached this estimator to the wrong
* operator.)
*/
if (((Const *) other)->consttype !=
get_function_sibling_type(fcinfo->flinfo->fn_oid, "query_int"))
{
ReleaseVariableStats(vardata);
PG_RETURN_FLOAT8(DEFAULT_EQ_SEL);
}

query = DatumGetQueryTypeP(((Const *) other)->constvalue);

/* Empty query matches nothing */
Expand Down
10 changes: 6 additions & 4 deletions contrib/jsonb_plpython/jsonb_plpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,24 @@ typedef PyObject *(*PLyUnicode_FromStringAndSize_t)
(const char *s, Py_ssize_t size);
static PLyUnicode_FromStringAndSize_t PLyUnicode_FromStringAndSize_p;

/* Static asserts verify that typedefs above match original declarations */
StaticAssertVariableIsOfType(&PLyObject_AsString, PLyObject_AsString_t);
StaticAssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
StaticAssertVariableIsOfType(&PLy_elog_impl, PLy_elog_impl_t);


/*
* Module initialize function: fetch function pointers for cross-module calls.
*/
void
_PG_init(void)
{
/* Asserts verify that typedefs above match original declarations */
AssertVariableIsOfType(&PLyObject_AsString, PLyObject_AsString_t);
PLyObject_AsString_p = (PLyObject_AsString_t)
load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyObject_AsString",
true, NULL);
AssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
PLyUnicode_FromStringAndSize_p = (PLyUnicode_FromStringAndSize_t)
load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyUnicode_FromStringAndSize",
true, NULL);
AssertVariableIsOfType(&PLy_elog_impl, PLy_elog_impl_t);
PLy_elog_impl_p = (PLy_elog_impl_t)
load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLy_elog_impl",
true, NULL);
Expand Down
3 changes: 2 additions & 1 deletion contrib/ltree/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ltree_crc32_sz(const char *buf, int size)
{
pg_crc32 crc;
const char *p = buf;
const char *end = buf + size;
static pg_locale_t locale = NULL;

if (!locale)
Expand All @@ -32,7 +33,7 @@ ltree_crc32_sz(const char *buf, int size)
while (size > 0)
{
char foldstr[UNICODE_CASEMAP_BUFSZ];
int srclen = pg_mblen(p);
int srclen = pg_mblen_range(p, end);
size_t foldlen;

/* fold one codepoint at a time */
Expand Down
4 changes: 2 additions & 2 deletions contrib/ltree/lquery_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ getlexeme(char *start, char *end, int *len)
char *ptr;

while (start < end && t_iseq(start, '_'))
start += pg_mblen(start);
start += pg_mblen_range(start, end);

ptr = start;
if (ptr >= end)
return NULL;

while (ptr < end && !t_iseq(ptr, '_'))
ptr += pg_mblen(ptr);
ptr += pg_mblen_range(ptr, end);

*len = ptr - start;
return start;
Expand Down
2 changes: 1 addition & 1 deletion contrib/ltree/ltree.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ typedef struct
#define LQUERY_HASNOT 0x01

/* valid label chars are alphanumerics, underscores and hyphens */
#define ISLABEL(x) ( t_isalnum(x) || t_iseq(x, '_') || t_iseq(x, '-') )
#define ISLABEL(x) ( t_isalnum_cstr(x) || t_iseq(x, '_') || t_iseq(x, '-') )

/* full text query */

Expand Down
8 changes: 4 additions & 4 deletions contrib/ltree/ltree_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ parse_ltree(const char *buf, struct Node *escontext)
ptr = buf;
while (*ptr)
{
charlen = pg_mblen(ptr);
charlen = pg_mblen_cstr(ptr);
if (t_iseq(ptr, '.'))
num++;
ptr += charlen;
Expand All @@ -69,7 +69,7 @@ parse_ltree(const char *buf, struct Node *escontext)
ptr = buf;
while (*ptr)
{
charlen = pg_mblen(ptr);
charlen = pg_mblen_cstr(ptr);

switch (state)
{
Expand Down Expand Up @@ -291,7 +291,7 @@ parse_lquery(const char *buf, struct Node *escontext)
ptr = buf;
while (*ptr)
{
charlen = pg_mblen(ptr);
charlen = pg_mblen_cstr(ptr);

if (t_iseq(ptr, '.'))
num++;
Expand All @@ -311,7 +311,7 @@ parse_lquery(const char *buf, struct Node *escontext)
ptr = buf;
while (*ptr)
{
charlen = pg_mblen(ptr);
charlen = pg_mblen_cstr(ptr);

switch (state)
{
Expand Down
2 changes: 1 addition & 1 deletion contrib/ltree/ltxtquery_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gettoken_query(QPRS_STATE *state, int32 *val, int32 *lenval, char **strval, uint

for (;;)
{
charlen = pg_mblen(state->buf);
charlen = pg_mblen_cstr(state->buf);

switch (state->state)
{
Expand Down
5 changes: 3 additions & 2 deletions contrib/ltree_plpython/ltree_plpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ PG_MODULE_MAGIC_EXT(
typedef PyObject *(*PLyUnicode_FromStringAndSize_t) (const char *s, Py_ssize_t size);
static PLyUnicode_FromStringAndSize_t PLyUnicode_FromStringAndSize_p;

/* Static asserts verify that typedefs above match original declarations */
StaticAssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);


/*
* Module initialize function: fetch function pointers for cross-module calls.
*/
void
_PG_init(void)
{
/* Asserts verify that typedefs above match original declarations */
AssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
PLyUnicode_FromStringAndSize_p = (PLyUnicode_FromStringAndSize_t)
load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyUnicode_FromStringAndSize",
true, NULL);
Expand Down
1 change: 1 addition & 0 deletions contrib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ subdir('pgcrypto')
subdir('pg_freespacemap')
subdir('pg_logicalinspect')
subdir('pg_overexplain')
subdir('pg_plan_advice')
subdir('pg_prewarm')
subdir('pgrowlocks')
subdir('pg_stat_statements')
Expand Down
4 changes: 2 additions & 2 deletions contrib/oid2name/oid2name.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ void
sql_exec_dumpalltables(PGconn *conn, struct options *opts)
{
char todo[1024];
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\", pg_relation_filepath(c.oid) as \"Path\" ";

snprintf(todo, sizeof(todo),
"SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s "
Expand Down Expand Up @@ -507,7 +507,7 @@ sql_exec_searchtables(PGconn *conn, struct options *opts)
*comma_filenumbers,
*comma_tables;
bool written = false;
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\", pg_relation_filepath(c.oid) as \"Path\" ";

/* get tables qualifiers, whether names, filenumbers, or OIDs */
comma_oids = get_comma_elts(opts->oids);
Expand Down
Loading