Keeping state in a foreign data wrapper

Поиск
Список
Период
Сортировка
От Stelios Sfakianakis
Тема Keeping state in a foreign data wrapper
Дата
Msg-id C6E9F37F-0D02-4BA4-8BB8-C808A31508A1@gmail.com
обсуждение исходный текст
Ответы Re: Keeping state in a foreign data wrapper  (Ian Lawrence Barwick <barwick@gmail.com>)
Список pgsql-general
Hi,

I am trying to  implement a FDW in Postgres for accessing a web api and I would like to keep information like for
examplethe total number of requests submiited. Ideally these data should be kept “per-user” and of course with the
properlocking to eliminate race conditions. So the question I have is how to design such a global (but per user and
database)state, using the C FDW API of Postgres. I have gone through the API and for example I see various fdw_private
fieldsin the query planning structures and callbacks but these do not seem to be relevant to my requirements. Another
possiblityseems to be to use shared memory (https://www.postgresql.org/docs/12/xfunc-c.html#id-1.8.3.13.14) but it is
evenless clear how to do it. 

So is there any simple way to do implement such shared thread/process safe state?
Thank you
Stelios






В списке pgsql-general по дате отправления:

Предыдущее
От: alex m
Дата:
Сообщение: Re: How to get the name of the current database in C function/extention inside a trigger?
Следующее
От: Konireddy Rajashekar
Дата:
Сообщение: How to rebuild index efficiently