Re: Writing triggers in C++

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: Writing triggers in C++
Дата
Msg-id 45D3095B.1090203@phlo.org
обсуждение исходный текст
Ответ на Re: Writing triggers in C++  (Andreas Pflug <pgadmin@pse-consulting.de>)
Ответы Re: Writing triggers in C++
Список pgsql-hackers
Andreas Pflug wrote:
> Tom Lane wrote:
>> Jacob Rief <jacob.rief@gmx.at> writes:
>>   
>>> I tried to write a trigger using C++.
>>>     
>> That is most likely not going to work anyway, because the backend
>> operating environment is C not C++.  If you dumb it down enough
>> --- no exceptions, no RTTI, no use of C++ library --- then it might
>> work, 
> I can confirm that it does work this way.

I've written an aggregate function that uses c++ stl hashes, and it 
seems to work pretty well. I'd think that using exceptions should be
fine, as long as you make sure to _always_ catch any exception that
might be thrown inside your own c++ code, and don't let it propagate
into backend code. STL allows you to specify custom allocator classes
as template parameters to hash, vector and the like. You can use that
to let STL allocate memory from the correct memory context.

greetings, Florian Pflug


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

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: Writing triggers in C++
Следующее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: HOT for PostgreSQL 8.3