Re: Maintaining state across function calls

From: "Kevin Grittner" <kgrittn(at)mail(dot)com>
To: "Craig Ringer" <craig(at)2ndQuadrant(dot)com>,matt(at)byrney(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Maintaining state across function calls
Date: 2012-11-21 02:26:30
Message-ID: 20121121022630.156390@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Grittner 2012-11-21 03:46:02 Re: Performance Testing Metrics
Previous Message Kevin Grittner 2012-11-21 02:08:52 Re: Experiences with pl/Java