Implementing LRU cache for postgresql extension

2023-10-02 Thread Lakshmi Narayana Velayudam
Hi I am trying to implement a LRU cache in postgres extension. Please find the markdown file for more details. Looking forward to hearing from you. I am trying to write an LRU cache which can hold any type of data item in c for a postgresql extension. Everything is fine except that I am relying on

Usage of ProcessConfigfile in SIGHUP_Handler

2024-08-22 Thread Lakshmi Narayana Velayudam
Hi pgsql hacker, Recently I have been trying to understand why GUC changes will be visible even though they are done in the signal handler as part of *ProcessConfigfile* (done in some extension code). Later I have seen almost all postgresql processes/bgworkers use signal handler to set a variable

Re: Usage of ProcessConfigfile in SIGHUP_Handler

2024-08-22 Thread Lakshmi Narayana Velayudam
On Thu, Aug 22, 2024 at 8:46 PM Nathan Bossart wrote: > > > I think this is no longer true as of v16, thanks to commit 7389aad [0]. > My Bad Nathan, was looking at PG 11, 14 codes. Just to be sure, calling *ProcessConfigFile *is a bug from a signal handler is a bug, right? Since it uses AllocSet

Re: Usage of ProcessConfigfile in SIGHUP_Handler

2024-08-22 Thread Lakshmi Narayana Velayudam
On Thu, Aug 22, 2024 at 9:50 PM Tom Lane wrote: > > > The previous postmaster coding blocked signals > > everywhere except immediately around the main loop's select() call, > > so there wasn't any real hazard of signal handlers interrupting > > anything of concern. We redid it for cleanliness, n

C extension compilation failed while using PG 17.2 on mac m1

2025-05-16 Thread Lakshmi Narayana Velayudam
Hello, while compiling my c extension with PG 17,2 I am getting postgresql-17.2/pgsql/include/server/port/pg_iovec.h:93:10: error: call to undeclared function 'pwritev'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 93 | retur

PG 17.2 compilation fails with -std=c11 on mac

2025-05-16 Thread Lakshmi Narayana Velayudam
Hello, When I trying to compiling postgres 17.2 with -std=c11 I am getting the below error on mac explicit_bzero.c:22:9: error: call to undeclared function 'memset_s'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 22 | (void) memset_

Copy Tuple Desc in internal_get_result_type

2025-05-24 Thread Lakshmi Narayana Velayudam
sue with a C extension: https://github.com/narayana-dev/srfbug Additionally, I have attached the patch file for your review. I look forward to your feedback. Best regards, Lakshmi Narayana Velayudam copy_tup_desc.patch Description: Binary data

Handling OID Changes in Regression Tests for C Extensions

2025-06-14 Thread Lakshmi Narayana Velayudam
Dear pg-hackers, I am facing a challenge related to OID changes in regression tests while working on a PostgreSQL C extension. Whenever I add or remove a function to the SQL file, it alters OIDs and leads to cascading modifications in multiple test files. This creates a significant overhead in mai