Exposing guc_malloc/strdup/realloc for plugins?

Started by Michael Paquierover 8 years ago2 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t38673
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 27, 2026 at 08:31 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t38673_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t38673_1 && git checkout t38673_1

Patchset v1 (message #1) is on t38673_1

Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi all,

While hacking on an extension, I have finished by doing things similar
to guc_malloc & friends for the allocation of a GUC parameter for malloc
portability. While that's not really a big deal to copy/paste this
code, I am wondering if it would make sense to expose them for extension
developers. Please see the attached for the simple idea.

Thanks,
--
Michael

Attachments:

t38673_1
guc-alloc-extern.patchtext/x-diff; charset=us-asciiDownload+9-4
In reply to: Michael Paquier (#1)
Re: Exposing guc_malloc/strdup/realloc for plugins?

2018-05-08 3:46 GMT-03:00 Michael Paquier <michael@paquier.xyz>:

While hacking on an extension, I have finished by doing things similar
to guc_malloc & friends for the allocation of a GUC parameter for malloc
portability. While that's not really a big deal to copy/paste this
code, I am wondering if it would make sense to expose them for extension
developers. Please see the attached for the simple idea.

Although I didn't need similar code on some extensions, code reuse is
always a good goal.

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento