0002-Mark-pg_mblen-and-t_is-as-deprecated.patch
text/x-patch
Filename: 0002-Mark-pg_mblen-and-t_is-as-deprecated.patch
Type: text/x-patch
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0002
Subject: Mark pg_mblen() and t_is*() as deprecated.
| File | + | − |
|---|---|---|
| src/include/mb/pg_wchar.h | 1 | 1 |
| src/include/tsearch/ts_locale.h | 1 | 1 |
From 57badb2c9b3363ac2f10dd4df222b2bb6c405e82 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Wed, 1 Apr 2026 22:28:25 +1300
Subject: [PATCH 2/3] Mark pg_mblen() and t_is*() as deprecated.
These functions were deprecated by commit 1e7fe06c and shouldn't be used
in new code. Adding a deprecated attribute will cause warnings in
extension code that is using them.
Backpatch-through: 14
Reviewed-by:
Discussion:
---
src/include/mb/pg_wchar.h | 2 +-
src/include/tsearch/ts_locale.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index e1655fe61d6..a3326e365a7 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -700,7 +700,7 @@ extern int pg_mblen_range(const char *mbstr, const char *end);
extern int pg_mblen_with_len(const char *mbstr, int limit);
extern int pg_mblen_unbounded(const char *mbstr);
-/* deprecated */
+pg_attribute_deprecated("use pg_mblen_{cstr,range,with_len,unbounded} instead")
extern int pg_mblen(const char *mbstr);
extern int pg_dsplen(const char *mbstr);
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index 6e2d67ee4a5..90e533eea31 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -60,7 +60,7 @@ extern int t_is##character_class##_with_len(const char *ptr, int len); \
extern int t_is##character_class##_cstr(const char *ptr); \
extern int t_is##character_class##_unbounded(const char *ptr); \
\
-/* deprecated */ \
+pg_attribute_deprecated("use t_isXXX_{cstr,with_len,unbounded} instead") \
extern int t_is##character_class(const char *ptr);
GENERATE_T_ISCLASS_DECL(alnum);
--
2.53.0