Global variable/memory context for PostgreSQL functions

From: Sajti Zsolt Zoltán <qnwbq9(at)inf(dot)elte(dot)hu>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Global variable/memory context for PostgreSQL functions
Date: 2022-06-16 15:00:10
Message-ID: DB9PR10MB484636FF6BE61659C17C950BDCAC9@DB9PR10MB4846.EURPRD10.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear PostgreSQL Developers,

I'm currently working on a GiST extension (a new index structure) for PostgreSQL
and I want to make it as customizable as I can. To achieve my goal I'm trying to take
advantage of the options GiST support function to provide extra parameters to the
operator class.

Because I'm creating a new index structure, I've also developed new operators
where I want to access the value of the operator class parameters as well. My main
problem is that I can't do that, because the parameters are only accessible from the
registered GiST support functions through specific macros.

To solve the problem, I've tried to use global variables but it was very inconsistent
because of the complex memory management of the whole system (also, I'm not as
great in C programming as I want to be).

Could you please help, by telling me that iss there any way to store and access
values globally in PostgreSQL? I want to store these values in a way that is not
affected by restarting the database server or maybe the whole computer.

I would really appreciate your help. Thanks in advance!

Best regards,
Zsolt

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2022-06-16 16:04:12 Re: Tightening behaviour for non-immutable behaviour in immutable functions
Previous Message Aleksander Alekseev 2022-06-16 13:40:55 Re: CREATE TABLE ( .. STORAGE ..)