Global variable/memory context for PostgreSQL functions - Mailing list pgsql-hackers

From Sajti Zsolt Zoltán
Subject Global variable/memory context for PostgreSQL functions
Date
Msg-id DB9PR10MB484636FF6BE61659C17C950BDCAC9@DB9PR10MB4846.EURPRD10.PROD.OUTLOOK.COM
Whole thread Raw
List 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

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: CREATE TABLE ( .. STORAGE ..)
Next
From: Greg Stark
Date:
Subject: Re: Tightening behaviour for non-immutable behaviour in immutable functions