I finally put enough code together and it has some chance it could
work.
It's time to test it.
Now I'm going to test it quite frequently.
My code is written and compiled in my ~/.
Then it is moved through svn to a test box where it is compiled under
another version of postgres, but still it ends up "far away" from
anything pg related.
Now it would be nice to be able to test it without any modification
to the source (namely the sql.in file). But the kosher way to write
one and then be able to eventually package it into a deb or even
make it reach contrib would be to use $libdir.
I can't make install (provided it works as expected, I didn't try
yet) since I sincerely hope that my user doesn't have write right on
whatever is pointed by $libdir.
My *nix user is also postgres superuser.
One way would be to
- let postgres user (or anyone) read in the dev dir
- export USE_PGXS=1; export someunknownparam=`pwd`; make
So that the resulting module.sql will point to the dev dir.
Does that someunknownparam exist?
2nd choice would be to write a bash script that just
- make
- sed -e 's/\$libdir/'`pwd`'/g' module.sql > module.l.sql
- sed -e 's/\$libdir/'`pwd`'/g' uninstall_module.sql >
uninstall_module.l.sql
- psql < sometestcode.sql
Not that bad... but if that "someunknownparam" existed it would be
nicer and avoid hard coding the module name in 2 places (Makefile and
bash script)[1]
[1] OK I know I can parse the Makefile with sed... ;)
thanks
--
Ivan Sergio Borgonovo
http://www.webthatworks.it