Re: Contrib -- PostgreSQL shared variables - Mailing list pgsql-hackers

From pgsql@mohawksoft.com
Subject Re: Contrib -- PostgreSQL shared variables
Date
Msg-id 17027.24.91.171.78.1093470448.squirrel@mail.mohawksoft.com
Whole thread Raw
In response to Re: Contrib -- PostgreSQL shared variables  (Rick Gigger <rick@alpinenetworking.com>)
List pgsql-hackers
> LockShared('name');

Hmmm, I thought about that, but it is *WAY* more complicated than it
looks. What if after a "Lock" the process crashes before it can call
"Unlock?" It is this problem that inspired the "add" and "sub" calls.



>
> pgsql@mohawksoft.com wrote:
>> This is a first pass on a simple shared memory variable system for
>> PostgreSQL. I would appriciate anyone interested in this functionality
>> to
>> rip it apart.
>>
>> It basically adds this functionality:
>>
>> SetShared('name', value);
>> GetSharedInt('name');
>> SetSharedText('name);
>> RemovedShared('name');
>>
>> I also added two extra functions that are sort of a kludge, but could be
>> very helpful.
>>
>> AddSharedInt('name', value);
>> SubSharedInt('name', value);
>>
>> These add or subtect the 'value' from the variable and return the
>> result.
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 9: the planner will ignore your desire to choose an index scan if
>> your
>>       joining column's datatypes do not match
>


pgsql-hackers by date:

Previous
From: Rick Gigger
Date:
Subject: Re: Contrib -- PostgreSQL shared variables
Next
From: Tom Lane
Date:
Subject: Re: printing HeapTuple