Re: [HACKERS] Writing triggers in C++

2007-02-18 Thread Jacob Rief
Tom Lane wrote: > 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, but at that point you're really coding in C anyway. Writing "normal"

Re: [HACKERS] Writing triggers in C++

2007-02-15 Thread bjarne
On Feb 14, 11:26 am, [EMAIL PROTECTED] ("Florian G. Pflug") wrote: > Neil Conway wrote: > > On Wed, 2007-02-14 at 13:19 -0300, Alvaro Herrera wrote: > >> Probably stack allocation doesn't matter much, as I think that would be > >> unwinded by the longjmp call. I don't know a lot about C++, but if

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Andreas Seltenreich
Florian G. Pflug writes: >>> Maybe we should create some wiki page or pgfoundry project that collects >>> all glue code, tipps and tricks that people invented to glue C++ into >>> the postgres backend. >> >> If it can be made to work, sure; in techdocs. > > I was thinking that two pairs of macros,

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Florian G. Pflug
Neil Conway wrote: On Wed, 2007-02-14 at 13:19 -0300, Alvaro Herrera wrote: Probably stack allocation doesn't matter much, as I think that would be unwinded by the longjmp call. I don't know a lot about C++, but if there are allocations in the data area then those would probably not be freed.

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Florian G. Pflug
Alvaro Herrera wrote: Florian G. Pflug wrote: Alvaro Herrera wrote: Florian G. Pflug wrote: Andreas Pflug wrote: Tom Lane wrote: Jacob Rief <[EMAIL PROTECTED]> writes: I tried to write a trigger using C++. That is most likely not going to work anyway, because the backend operating envi

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Neil Conway
On Wed, 2007-02-14 at 13:19 -0300, Alvaro Herrera wrote: > Probably stack allocation doesn't matter much, as I think that would be > unwinded by the longjmp call. I don't know a lot about C++, but if > there are allocations in the data area then those would probably not be > freed. But it makes m

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Alvaro Herrera
Florian G. Pflug wrote: > Alvaro Herrera wrote: > >Florian G. Pflug wrote: > >>Andreas Pflug wrote: > >>>Tom Lane wrote: > Jacob Rief <[EMAIL PROTECTED]> writes: > > >I tried to write a trigger using C++. > > > That is most likely not going to work anyway, because the backe

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Florian G. Pflug
Alvaro Herrera wrote: Florian G. Pflug wrote: Andreas Pflug wrote: Tom Lane wrote: Jacob Rief <[EMAIL PROTECTED]> 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 eno

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Alvaro Herrera
Florian G. Pflug wrote: > Andreas Pflug wrote: > >Tom Lane wrote: > >>Jacob Rief <[EMAIL PROTECTED]> 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

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Florian G. Pflug
Andreas Pflug wrote: Tom Lane wrote: Jacob Rief <[EMAIL PROTECTED]> 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++

Re: [HACKERS] Writing triggers in C++

2007-02-14 Thread Andreas Pflug
Tom Lane wrote: > Jacob Rief <[EMAIL PROTECTED]> 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

Re: [HACKERS] Writing triggers in C++

2007-02-13 Thread Tom Lane
Jacob Rief <[EMAIL PROTECTED]> 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, but at that poi

Re: [HACKERS] Writing triggers in C++

2007-02-13 Thread Peter Eisentraut
Jacob Rief wrote: > Is there any convention how to rename such identifiers? If I would > rename those identifiers (I simply would add an underscore to each of > them), would such a patch be accepted and adopted onto one of the > next releases? Couldn't you do the required renamings as preprocessor

[HACKERS] Writing triggers in C++

2007-02-13 Thread Jacob Rief
I tried to write a trigger using C++. This requires to include the following header-files: extern "C" { #include #include #include #include } Unfortunately some of the included headers define some structs and functions where a few identifiers are C++ keywords. The compiler-directive 'extern "