]> git.openstreetmap.org Git - rails.git/blob - db/functions/xid_to_int4.c
Merge remote-tracking branch 'upstream/pull/2957' into master
[rails.git] / db / functions / xid_to_int4.c
1 #include <postgres.h>
2 #include <fmgr.h>
3
4 Datum
5 xid_to_int4(PG_FUNCTION_ARGS)
6 {
7    TransactionId xid = PG_GETARG_INT32(0);
8
9    PG_RETURN_INT32(xid);
10 }
11
12 PG_FUNCTION_INFO_V1(xid_to_int4);
13
14 /*
15  * To bind this into PGSQL, try something like:
16  *
17  * CREATE FUNCTION xid_to_int4(xid) RETURNS int4
18  *  AS '/path/to/rails-port/db/functions/libpgosm', 'xid_to_int4'
19  *  LANGUAGE C IMMUTABLE STRICT;
20  *
21  * (without all the *s)
22  */