Subject: Cleanup: Use modern macro for text-to-CString conversion in plsample.c

From: Amul Sul <[email-masked]>
Date: Fri, 17 Apr 2026 18:24:58 +0530

Hi,

I noticed that plsample.c uses an outdated method to convert text data
to a C string. This old method calls the textout function manually,
which adds unnecessary overhead.

The attached patch replaces this with the TextDatumGetCString() macro.
This macro is more efficient and automatically handles "detoasting"
(decompressing/fetching) the data.

Since plsample serves as a template for developers writing new
extensions, it should follow current best practices. This patch
updates the code in both the function and trigger handlers.

--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

---

From: Fujii Masao <[email-masked]>
Date: Mon, 20 Apr 2026 21:20:22 +0900

> updates the code in both the function and trigger handlers.

LGTM.

Regards,

-- 
Fujii Masao

---

From: Fujii Masao <[email-masked]>
Date: Tue, 21 Apr 2026 08:41:38 +0900

> LGTM.

I've pushed the patch. Thanks!

Regards,

-- 
Fujii Masao

---

From: Amul Sul <[email-masked]>
Date: Tue, 21 Apr 2026 09:27:09 +0530

> I've pushed the patch. Thanks!

Thank you, Fujii-san.

Regards,
Amul