[GENERAL] Extension coverage

2017-08-25 Thread Gabriel Furstenheim Milerud
Hello, I'm trying to measure test coverage on an extension. I've built postgres with the --enable-coverage flag: $ cd $POSTGRES_SOURCE_DIR $ ./configure --enable-coverage $ make $ make install The I built my extension against this postgres server $ cd $EXTENSION_SOURCE_DIR

Re: [GENERAL] Executing regex in C code

2017-07-30 Thread Gabriel Furstenheim Milerud
Thanks a lot, That did the trick Best regards On 30 July 2017 at 18:26, Tom Lane wrote: > Gabriel Furstenheim Milerud writes: > > I'm trying to execute the equivalent to '~' with regexp from within C > code. > > > text * s = cstring_to_text("

[GENERAL] Executing regex in C code

2017-07-30 Thread Gabriel Furstenheim Milerud
Hi, I'm trying to execute the equivalent to '~' with regexp from within C code. According to pg_operator this operator for type text corresponds to textregexeq: DATA(insert OID =

Re: [GENERAL] Freeing memory in native extension in case of error

2017-06-15 Thread Gabriel Furstenheim Milerud
Great, thanks On 15 June 2017 at 22:07, Tom Lane wrote: > Gabriel Furstenheim Milerud writes: >> I've written an extension in C to sum jsonb. For that I use the >> jsonbiterator defined in >> https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/jso

[GENERAL] Freeing memory in native extension in case of error

2017-06-15 Thread Gabriel Furstenheim Milerud
Hi, I've written an extension in C to sum jsonb. For that I use the jsonbiterator defined in https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/jsonb_util.c#L743 In the comments of JsonbIteratorNext it states: 'Callers in such a scenario, that are particularly sensitive to leak