Re: plugin dev, oid to pointer map

From: Attila Soki <atiware(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: plugin dev, oid to pointer map
Date: 2016-05-30 18:41:53
Message-ID: 6EB0D3B6-7D71-4795-B1E5-FD2E4D450CF0@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On 30 May 2016, at 02:43, Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com> wrote:
>
> On 29/05/2016 22:10, Attila Soki wrote:
>> i am about to begin with postgresql plugin development.
>> H Currently i'm trying to become somewhat familiar with the postgresql sources.
>
>>
>> Without going too deep into details about the plugin, i want to use
>> many Oid to pointer relations.
>> The pointer is a pointer to my own struct (allocated with palloc).
>> There will be approx. 1000 unique oid/pointer pairs.
>>
>> Basically, what i want is, to be able to get the pointer to my struct by Oid.
>>
>> Is there is a suitable hashmap or key-value storage solution in the pg code?
>> if so, please point me to the right part of the source.
>>
>
> Yes, there's an hashtable implementation, see dynahash.c
>
> If you want to use that in shared memory in your extension, you can look
> at the pg_stat_statements extension (look for pgss_hash) for an example.

Hello Julien,

exactly what i need

Thank you

Attila Soki

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-05-30 18:50:08 Re: Deleting a table file does not raise an error when the table is touched afterwards, why?
Previous Message David W Noon 2016-05-30 18:40:35 Re: Deleting a table file does not raise an error when the table is touched afterwards, why?