I want to create an extension test in postgres (Using PostGis), so I want to do the following steps:
1.- Edit the file btree_interval.c from btree_gist in this way:
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;
}
Only add a printf, because I just want to do a little test
2.- Run the following command:
gcc -shared -o btree_gist_test.so -fPIC btree_gist.c
My doubts are:
1.- I don't know where I can find the file
btree_gist.conce postgresql is installed and then run the command above.
If you ask me: 'Why don't just you do that downloading the source code?' Well, because When I did, I got this error message:
#include "postgres.h"
^
compilation terminated
So, I thought that it's better do it in the same folder where postgresql is already installed.
2.- Once I get the btree_gist_test.so I know that I have to copy to the path
/usr/lib/postgresql/lib/, but I'm not sure if I have to create a symbolic link to a somewhere else for this file.