libmyosm.so: quadtile-mysql.o maptile-mysql.o
cc ${LDFLAGS} -o libmyosm.so quadtile-mysql.o maptile-mysql.o
-libpgosm.so: quadtile-pgsql.o maptile-pgsql.o
- cc ${LDFLAGS} -o libpgosm.so quadtile-pgsql.o maptile-pgsql.o
+libpgosm.so: quadtile-pgsql.o maptile-pgsql.o xid_to_int4-pgsql.o
+ cc ${LDFLAGS} -o libpgosm.so quadtile-pgsql.o maptile-pgsql.o xid_to_int4-pgsql.o
quadtile-mysql.o: quadtile.c ${QTDIR}/quad_tile.h
cc `mysql_config --include` -I${QTDIR} -fPIC -O3 -DUSE_MYSQL -c -o quadtile-mysql.o quadtile.c
maptile-pgsql.o: maptile.c
cc -I `pg_config --includedir-server` -fPIC -O3 -DUSE_PGSQL -c -o maptile-pgsql.o maptile.c
+
+xid_to_int4-pgsql.o: xid_to_int4.c
+ cc -I `pg_config --includedir-server` -fPIC -O3 -DUSE_PGSQL -c -o xid_to_int4-pgsql.o xid_to_int4.c
--- /dev/null
+#ifndef USE_MYSQL
+#ifndef USE_PGSQL
+#error One of USE_MYSQL or USE_PGSQL must be defined
+#endif
+#endif
+
+#ifdef USE_PGSQL
+#ifdef USE_MYSQL
+#error ONLY one of USE_MYSQL and USE_PGSQL should be defined
+#endif
+
+#include <postgres.h>
+#include <fmgr.h>
+
+int xid_to_int4(TransactionId xid)
+{
+ return xid;
+}
+
+/*
+ * To bind this into PGSQL, try something like:
+ *
+ * CREATE FUNCTION xid_to_int4(xid) RETURNS int4
+ * AS '/path/to/rails-port/db/functions/libpgosm', 'xid_to_int4'
+ * LANGUAGE C IMMUTABLE STRICT;
+ *
+ * (without all the *s)
+ */
+
+#endif