I want to create an extension test in postgres (using PostGis), so I want to take the following steps:
1.- Edit the file btree_interval.c
from btree_gist like this:
gbt_intvkey_cmp(const void *a, const void *b)
{
intvKEY *ia = (intvKEY *) (((const Nsrt *) a)->t);
intvKEY *ib = (intvKEY *) (((const Nsrt *) b)->t);
int res;
......
......
printf("Test for PostGis\n");
return res;
}
Add only printf
because I just want to check a little
2.- Run the following command:
gcc -shared -o btree_gist_test.so -fPIC btree_gist.c
My doubts:
1.- I do not know where I can find the file btree_gist.c
after installing postgresql, and then execute the command above.
If you ask me: "Why don't you just download the source code?" Well, because when I did this, I received an error message:
#include "postgres.h"
^
compilation terminated
So, I thought it was better to do this in the same folder where postgresql is already installed.
2.- btree_gist_test.so, , /usr/lib/postgresql/lib/
, , .