agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: plsample: Use TextDatumGetCString() for text-to-CString conversi
Date: Mon, 20 Apr 2026 23:40:10 +0000
Message-ID: <E1wEyDp-001vd9-1v@gemulon.postgresql.org> (raw)
plsample: Use TextDatumGetCString() for text-to-CString conversion
Replace the outdated DatumGetCString(DirectFunctionCall1(textout, ...))
pattern with TextDatumGetCString(). The macro is the modern, more
efficient way to convert a text Datum to a C string as it avoids
unnecessary function call machinery and handles detoasting internally.
Since plsample serves as reference code for extension authors, it
should follow current idiomatic practices.
Author: Amul Sul <sulamul@gmail.com>
Discussion: https://postgr.es/m/CAAJ_b95-xMvUN1PEqxv8y6g-A-8k+fSgyv20kSZc9eF1wZAUPg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f1cfb48efb086f99f6995f5d4b8a7c3ee289d1f0
Modified Files
--------------
src/test/modules/plsample/plsample.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Message-ID: <E1wEyDp-001vd9-1v@gemulon.postgresql.org>
Permalink: ../E1wEyDp-001vd9-1v@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wEyDp-001vd9-1v@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: plsample: Use TextDatumGetCString() for text-to-CString conversi
In-Reply-To: <E1wEyDp-001vd9-1v@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox