Re: Maintaining state across function calls - Mailing list pgsql-general

From Kevin Grittner
Subject Re: Maintaining state across function calls
Date
Msg-id 20121121022630.156390@gmx.com
Whole thread Raw
In response to Maintaining state across function calls  (matt@byrney.com)
List pgsql-general
Craig Ringer wrote:

> If at all possible, isolate your C++ code from the PostgreSQL
> aggregate implementation. Pass the C++ code pre-allocated buffers
> to work with if you can, and manage the allocations in the Pg C
> code. Turn your C++ code into library that presents only `extern
> "C"` interfaces and opaque types if yu can.

+1

You definitely want to separately compile the C code which interfaces
with PostgreSQL and calls C entry points to the C++ code. A clear and
clean boundary here is critical to reliability and maintainability.

-Kevin


pgsql-general by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Experiences with pl/Java
Next
From: "Kevin Grittner"
Date:
Subject: Re: Performance Testing Metrics