diff -rN -c old-slony1-engine/src/backend/esm.h new-slony1-engine-1/src/backend/esm.h
*** old-slony1-engine/src/backend/esm.h	2005-08-26 16:18:43.000000000 +1000
--- new-slony1-engine-1/src/backend/esm.h	2005-08-26 16:25:20.000000000 +1000
***************
*** 0 ****
--- 1,33 ----
+ #ifndef SLONY_ESM_H
+ #define SLONY_ESM_H
+ 
+ #include "c.h"
+ #include "access/xact.h"
+ #include "edmipg.h"
+ 
+ extern TransactionState CurrentTransactionState;
+ 
+ typedef struct snapshot_tag {
+   char eye[4];
+   unsigned int tran_num;
+   EDMI_TranID_Detail next_tranid;
+   void *p1;
+   void *p2;
+   void *p3;
+   void *p4;
+   unsigned int cap;
+   EDMI_TranID_Detail tranid[1];
+ } *ESM_snapshot;
+ 
+ typedef uint64 ESMTransactionId;
+ 
+ /*
+  * XXX: There is no good reason for this to be a macro; it should
+  * probably just be a function instead. Note that this macro multiply
+  * evaluates its argument.
+  */
+ #define xid_to_uint64(xid) \
+     (((unsigned long long) (((EDMI_TranID_Detail) xid).upper) << 32) + \
+      ((long long unsigned) ((EDMI_TranID_Detail) xid).lower))
+ 
+ #endif /* ! SLONY_ESM_H */
diff -rN -c old-slony1-engine/src/backend/Makefile new-slony1-engine-1/src/backend/Makefile
*** old-slony1-engine/src/backend/Makefile	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/backend/Makefile	2005-08-26 16:24:50.000000000 +1000
***************
*** 11,17 ****
  slony_top_builddir = ../..
  include $(slony_top_builddir)/Makefile.global
  
! override CFLAGS += -I$(slony_top_builddir) $(CFLAGS_SL)
  
  NAME		= slony1_funcs
  
--- 11,17 ----
  slony_top_builddir = ../..
  include $(slony_top_builddir)/Makefile.global
  
! override CFLAGS += -I$(slony_top_builddir) -I$(slony_top_builddir)/src/backend $(CFLAGS_SL)
  
  NAME		= slony1_funcs
  
diff -rN -c old-slony1-engine/src/backend/slony1_base.sql new-slony1-engine-1/src/backend/slony1_base.sql
*** old-slony1-engine/src/backend/slony1_base.sql	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/backend/slony1_base.sql	2005-08-26 16:24:50.000000000 +1000
***************
*** 387,393 ****
  	log_cmddata			text
  );
  create index sl_log_1_idx1 on @NAMESPACE@.sl_log_1
! 	(log_origin, log_xid @NAMESPACE@.xxid_ops, log_actionseq);
  
  comment on table @NAMESPACE@.sl_log_1 is 'Stores each change to be propagated to subscriber nodes';
  comment on column @NAMESPACE@.sl_log_1.log_origin is 'Origin node from which the change came';
--- 387,393 ----
  	log_cmddata			text
  );
  create index sl_log_1_idx1 on @NAMESPACE@.sl_log_1
! 	(log_origin, log_xid,  log_actionseq);
  
  comment on table @NAMESPACE@.sl_log_1 is 'Stores each change to be propagated to subscriber nodes';
  comment on column @NAMESPACE@.sl_log_1.log_origin is 'Origin node from which the change came';
***************
*** 414,420 ****
  comment on column @NAMESPACE@.sl_log_2.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE';
  comment on column @NAMESPACE@.sl_log_2.log_cmddata is 'The data needed to perform the log action';
  create index sl_log_2_idx1 on @NAMESPACE@.sl_log_2
! 	(log_origin, log_xid @NAMESPACE@.xxid_ops, log_actionseq);
  
  
  -- **********************************************************************
--- 414,420 ----
  comment on column @NAMESPACE@.sl_log_2.log_cmdtype is 'Replication action to take. U = Update, I = Insert, D = DELETE';
  comment on column @NAMESPACE@.sl_log_2.log_cmddata is 'The data needed to perform the log action';
  create index sl_log_2_idx1 on @NAMESPACE@.sl_log_2
! 	(log_origin, log_actionseq);
  
  
  -- **********************************************************************
***************
*** 446,452 ****
  --	is not initialized yet.
  -- ----------------------------------------------------------------------
  create sequence @NAMESPACE@.sl_local_node_id
! 	MINVALUE -1;
  SELECT setval('@NAMESPACE@.sl_local_node_id', -1);
  comment on sequence @NAMESPACE@.sl_local_node_id is 'The local node ID is initialized to -1, meaning that this node is not initialized yet.';
  
--- 446,452 ----
  --	is not initialized yet.
  -- ----------------------------------------------------------------------
  create sequence @NAMESPACE@.sl_local_node_id
! 	MINVALUE -1 ESMNOCACHE;
  SELECT setval('@NAMESPACE@.sl_local_node_id', -1);
  comment on sequence @NAMESPACE@.sl_local_node_id is 'The local node ID is initialized to -1, meaning that this node is not initialized yet.';
  
***************
*** 456,462 ****
  --
  --	The sequence for numbering events originating from this node.
  -- ----------------------------------------------------------------------
! create sequence @NAMESPACE@.sl_event_seq;
  comment on sequence @NAMESPACE@.sl_event_seq is 'The sequence for numbering events originating from this node.';
  
  -- ----------------------------------------------------------------------
--- 456,462 ----
  --
  --	The sequence for numbering events originating from this node.
  -- ----------------------------------------------------------------------
! create sequence @NAMESPACE@.sl_event_seq ESMNOCACHE;
  comment on sequence @NAMESPACE@.sl_event_seq is 'The sequence for numbering events originating from this node.';
  
  -- ----------------------------------------------------------------------
***************
*** 466,472 ****
  --	the replication engines can figure out the "agreeable" order of
  --	statements.
  -- ----------------------------------------------------------------------
! create sequence @NAMESPACE@.sl_action_seq;
  comment on sequence @NAMESPACE@.sl_action_seq is 'The sequence to number statements in the transaction logs, so that the replication engines can figure out the "agreeable" order of statements.';
  
  
--- 466,472 ----
  --	the replication engines can figure out the "agreeable" order of
  --	statements.
  -- ----------------------------------------------------------------------
! create sequence @NAMESPACE@.sl_action_seq ESMNOCACHE;
  comment on sequence @NAMESPACE@.sl_action_seq is 'The sequence to number statements in the transaction logs, so that the replication engines can figure out the "agreeable" order of statements.';
  
  
***************
*** 478,484 ****
  --	be modified and an int8 column added that serves as a rowid for us.
  --	The values are assigned with a default from this sequence.
  -- ----------------------------------------------------------------------
! create sequence @NAMESPACE@.sl_rowid_seq;
  grant select, update on @NAMESPACE@.sl_rowid_seq to public;
  comment on sequence @NAMESPACE@.sl_rowid_seq is 'Application tables that do not have a natural primary key must be modified and an int8 column added that serves as a rowid for us.  The values are assigned with a default from this sequence.';
  
--- 478,484 ----
  --	be modified and an int8 column added that serves as a rowid for us.
  --	The values are assigned with a default from this sequence.
  -- ----------------------------------------------------------------------
! create sequence @NAMESPACE@.sl_rowid_seq ESMNOCACHE;
  grant select, update on @NAMESPACE@.sl_rowid_seq to public;
  comment on sequence @NAMESPACE@.sl_rowid_seq is 'Application tables that do not have a natural primary key must be modified and an int8 column added that serves as a rowid for us.  The values are assigned with a default from this sequence.';
  
***************
*** 497,503 ****
  --		3		sl_log_2 active, sl_log_1 unknown - cleanup
  -- ----------------------------------------------------------------------
  create sequence @NAMESPACE@.sl_log_status
! 	MINVALUE 0 MAXVALUE 3;
  SELECT setval('@NAMESPACE@.sl_log_status', 0);
  comment on sequence @NAMESPACE@.sl_log_status is '
  Bit 0x01 determines the currently active log table
--- 497,503 ----
  --		3		sl_log_2 active, sl_log_1 unknown - cleanup
  -- ----------------------------------------------------------------------
  create sequence @NAMESPACE@.sl_log_status
! 	MINVALUE 0 MAXVALUE 3 ESMNOCACHE;
  SELECT setval('@NAMESPACE@.sl_log_status', 0);
  comment on sequence @NAMESPACE@.sl_log_status is '
  Bit 0x01 determines the currently active log table
diff -rN -c old-slony1-engine/src/backend/slony1_funcs.c new-slony1-engine-1/src/backend/slony1_funcs.c
*** old-slony1-engine/src/backend/slony1_funcs.c	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/backend/slony1_funcs.c	2005-08-26 16:24:50.000000000 +1000
***************
*** 29,39 ****
--- 29,43 ----
  #else
  #include "parser/parse_oper.h"
  #endif
+ #include "parser/keywords.h"
  #include "mb/pg_wchar.h"
  
+ #undef NDEBUG
+ #include <assert.h>
  #include <signal.h>
  #include <errno.h>
  
+ #include "esm.h"
  
  PG_FUNCTION_INFO_V1(_Slony_I_createEvent);
  PG_FUNCTION_INFO_V1(_Slony_I_getLocalNodeId);
***************
*** 79,85 ****
  #define SLON_ROLE_SLON		2
  
  
- 
  /* ----
   * Slony_I_ClusterStatus -
   *
--- 83,88 ----
***************
*** 91,97 ****
  	NameData	clustername;
  	char	   *clusterident;
  	int32		localNodeId;
! 	TransactionId currentXid;
  	int			session_role;
  	void	   *plan_active_log;
  
--- 94,100 ----
  	NameData	clustername;
  	char	   *clusterident;
  	int32		localNodeId;
! 	uint64		currentXid;
  	int			session_role;
  	void	   *plan_active_log;
  
***************
*** 124,130 ****
  Datum
  _Slony_I_createEvent(PG_FUNCTION_ARGS)
  {
! 	TransactionId newXid = GetTopTransactionId();
  	Slony_I_ClusterStatus *cs;
  	text	   *ev_xip;
  	char	   *ev_type_c;
--- 127,136 ----
  Datum
  _Slony_I_createEvent(PG_FUNCTION_ARGS)
  {
! 	uint64      newXid;
!     uint64      minxid;
!     uint64      maxxid;
! 
  	Slony_I_ClusterStatus *cs;
  	text	   *ev_xip;
  	char	   *ev_type_c;
***************
*** 138,143 ****
--- 144,150 ----
  	int			i;
  	int64		retval;
  	bool		isnull;
+ 	ESM_snapshot	ss;
  
  	if (SerializableSnapshot == NULL)
  		elog(ERROR, "Slony-I: SerializableSnapshot is NULL in createEvent()");
***************
*** 145,150 ****
--- 152,159 ----
  	if ((rc = SPI_connect()) < 0)
  		elog(ERROR, "Slony-I: SPI_connect() failed in createEvent()");
  
+ 	newXid = xid_to_uint64(CurrentTransactionState->tran_id);
+ 
  	/*
  	 * Get or create the cluster status information and make sure it has the
  	 * SPI plans that we need here.
***************
*** 158,164 ****
  	/*
  	 * Do the following only once per transaction.
  	 */
! 	if (!TransactionIdEquals(cs->currentXid, newXid))
  	{
  		/*
  		 * Once per transaction notify on the sl_event relation
--- 167,173 ----
  	/*
  	 * Do the following only once per transaction.
  	 */
! 	if (cs->currentXid != newXid)
  	{
  		/*
  		 * Once per transaction notify on the sl_event relation
***************
*** 173,189 ****
  	 * Build the comma separated list of transactions in progress as Text
  	 * datum.
  	 */
  	*(cp = buf) = '\0';
! 	for (xcnt = 0; xcnt < SerializableSnapshot->xcnt; xcnt++)
  	{
! 		if ((cp + 30) >= (buf + buf_size))
  		{
  			buf_size *= 2;
  			buf = repalloc(buf, buf_size);
  			cp = buf + strlen(buf);
  		}
! 		sprintf(cp, "%s'%u'", (xcnt > 0) ? "," : "",
! 				SerializableSnapshot->xip[xcnt]);
  		cp += strlen(cp);
  	}
  	ev_xip = DatumGetTextP(DirectFunctionCall1(textin, PointerGetDatum(buf)));
--- 182,208 ----
  	 * Build the comma separated list of transactions in progress as Text
  	 * datum.
  	 */
+ 
+ 	/*
+ 	 * Get the snapshot data out of ESM
+ 	 */
+ 	ss = (ESM_snapshot) SerializableSnapshot->snapshot_desc->snapshot_id;
+ 	minxid = xid_to_uint64(ss->tranid[0]);
+ 	maxxid = xid_to_uint64(ss->next_tranid);
+ 	assert(minxid < maxxid);
+ 
+ 	/* XXX: for each transid, add to list as int8 */
  	*(cp = buf) = '\0';
! 	for (xcnt = 0; xcnt < ss->tran_num; xcnt++)
  	{
! 		if ((cp + 60) >= (buf + buf_size))
  		{
  			buf_size *= 2;
  			buf = repalloc(buf, buf_size);
  			cp = buf + strlen(buf);
  		}
! 		assert(xid_to_uint64(ss->tranid[xcnt]) >= minxid);
! 		sprintf(cp, "%s'%llu'", (xcnt > 0) ? "," : "", xid_to_uint64(ss->tranid[xcnt]));
  		cp += strlen(cp);
  	}
  	ev_xip = DatumGetTextP(DirectFunctionCall1(textin, PointerGetDatum(buf)));
***************
*** 191,198 ****
  	/*
  	 * Call the saved INSERT plan
  	 */
! 	argv[0] = TransactionIdGetDatum(SerializableSnapshot->xmin);
! 	argv[1] = TransactionIdGetDatum(SerializableSnapshot->xmax);
  	argv[2] = PointerGetDatum(ev_xip);
  	nulls[0] = ' ';
  	nulls[1] = ' ';
--- 210,217 ----
  	/*
  	 * Call the saved INSERT plan
  	 */
! 	argv[0] = Int64GetDatum(minxid);
! 	argv[1] = Int64GetDatum(maxxid);
  	argv[2] = PointerGetDatum(ev_xip);
  	nulls[0] = ' ';
  	nulls[1] = ' ';
***************
*** 383,389 ****
  Datum
  _Slony_I_logTrigger(PG_FUNCTION_ARGS)
  {
! 	TransactionId newXid = GetTopTransactionId();
  	Slony_I_ClusterStatus *cs;
  	TriggerData *tg;
  	Datum		argv  [4];
--- 402,408 ----
  Datum
  _Slony_I_logTrigger(PG_FUNCTION_ARGS)
  {
! 	uint64 newXid;	
  	Slony_I_ClusterStatus *cs;
  	TriggerData *tg;
  	Datum		argv  [4];
***************
*** 395,400 ****
--- 414,421 ----
  	int			attkind_idx;
  	int			cmddata_need;
  
+ 	newXid = xid_to_uint64(CurrentTransactionState->tran_id);
+ 
  	/*
  	 * Get the trigger call context
  	 */
***************
*** 451,457 ****
  	/*
  	 * Do the following only once per transaction.
  	 */
! 	if (!TransactionIdEquals(cs->currentXid, newXid))
  	{
  		/*
  		 * Determine the currently active log table
--- 472,478 ----
  	/*
  	 * Do the following only once per transaction.
  	 */
! 	if (cs->currentXid != newXid)
  	{
  		/*
  		 * Determine the currently active log table
***************
*** 888,894 ****
  	/*
  	 * Construct the parameter array and insert the log row.
  	 */
! 	argv[0] = TransactionIdGetDatum(cs->currentXid);
  	argv[1] = Int32GetDatum(tab_id);
  	argv[2] = PointerGetDatum(cmdtype);
  	argv[3] = PointerGetDatum(cs->cmddata_buf);
--- 909,915 ----
  	/*
  	 * Construct the parameter array and insert the log row.
  	 */
! 	argv[0] = Int64GetDatum(cs->currentXid);
  	argv[1] = Int32GetDatum(tab_id);
  	argv[2] = PointerGetDatum(cmdtype);
  	argv[3] = PointerGetDatum(cs->cmddata_buf);
***************
*** 1317,1323 ****
  		/*
  		 * Initialize the currentXid to invalid
  		 */
! 		cs->currentXid = InvalidTransactionId;
  
  		/*
  		 * Insert the new control block into the list
--- 1338,1344 ----
  		/*
  		 * Initialize the currentXid to invalid
  		 */
! 		cs->currentXid = (uint64) InvalidTransactionId;
  
  		/*
  		 * Insert the new control block into the list
***************
*** 1355,1362 ****
  					makeString("xxid"));
  		xxid_typid = typenameTypeId(xxid_typename);
  
- 		plan_types[0] = INT4OID;
- 
  		/*
  		 * Create the saved plan. We lock the sl_event table in exclusive mode
  		 * in order to ensure that all events are really assigned sequence
--- 1376,1381 ----
diff -rN -c old-slony1-engine/src/slon/cleanup_thread.c new-slony1-engine-1/src/slon/cleanup_thread.c
*** old-slony1-engine/src/slon/cleanup_thread.c	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/slon/cleanup_thread.c	2005-08-26 16:24:50.000000000 +1000
***************
*** 33,40 ****
   */
  int			vac_frequency = SLON_VACUUM_FREQUENCY;
  static int vac_bias = 0;
! static unsigned long earliest_xid = 0;
! static unsigned long get_earliest_xid (PGconn *dbconn);
  
  /* The list of tables that need to be vacuumed by Slony-I */
  static char *table_list [] = {"%s.sl_event",
--- 33,40 ----
   */
  int			vac_frequency = SLON_VACUUM_FREQUENCY;
  static int vac_bias = 0;
! static unsigned long long earliest_xid = 0;
! static unsigned long long get_earliest_xid (PGconn *dbconn);
  
  /* The list of tables that need to be vacuumed by Slony-I */
  static char *table_list [] = {"%s.sl_event",
***************
*** 200,206 ****
  		 */
  		if (vac_frequency != 0 && ++vac_count >= vac_frequency)
  		{
! 			unsigned long latest_xid;
  			vac_count = 0;
  			latest_xid = get_earliest_xid(dbconn);
  			if (earliest_xid != latest_xid) {
--- 200,206 ----
  		 */
  		if (vac_frequency != 0 && ++vac_count >= vac_frequency)
  		{
! 			unsigned long long latest_xid;
  			vac_count = 0;
  			latest_xid = get_earliest_xid(dbconn);
  			if (earliest_xid != latest_xid) {
***************
*** 275,282 ****
     doing VACUUMs of the various Slony-I tables.
  */
  
! static unsigned long get_earliest_xid (PGconn *dbconn) {
! 	long long xid;
  	PGresult   *res;
  	SlonDString query1;
  	dstring_init(&query1);
--- 275,282 ----
     doing VACUUMs of the various Slony-I tables.
  */
  
! static unsigned long long get_earliest_xid (PGconn *dbconn) {
! 	unsigned long long xid;
  	PGresult   *res;
  	SlonDString query1;
  	dstring_init(&query1);
***************
*** 290,294 ****
  	} 
  	xid = strtoll(PQgetvalue(res, 0, 0), NULL, 10);
  	slon_log(SLON_DEBUG3, "cleanupThread: minxid: %d\n", xid);
! 	return (unsigned long) xid;
  }
--- 290,294 ----
  	} 
  	xid = strtoll(PQgetvalue(res, 0, 0), NULL, 10);
  	slon_log(SLON_DEBUG3, "cleanupThread: minxid: %d\n", xid);
! 	return (unsigned long long) xid;
  }
diff -rN -c old-slony1-engine/src/slon/sync_thread.c new-slony1-engine-1/src/slon/sync_thread.c
*** old-slony1-engine/src/slon/sync_thread.c	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/slon/sync_thread.c	2005-08-26 16:24:50.000000000 +1000
***************
*** 98,103 ****
--- 98,106 ----
  		/*
  		 * Start a serializable transaction and get the last value from the
  		 * action sequence number.
+          *
+          * XXX: rewrite this so that we don't bother running the
+          * transaction if the timeout has already expired
  		 */
  		res = PQexec(dbconn, dstring_data(&query1));
  		if (PQresultStatus(res) != PGRES_TUPLES_OK)
***************
*** 124,129 ****
--- 127,133 ----
  			 * Action sequence has changed, generate a SYNC event and read the
  			 * resulting currval of the event sequence.
  			 */
+             char *old_seq = strdup(last_actseq_buf);
  			strcpy(last_actseq_buf, PQgetvalue(res, 0, 0));
  
  			PQclear(res);
***************
*** 138,145 ****
  				break;
  			}
  			slon_log(SLON_DEBUG2,
! 					 "syncThread: new sl_action_seq %s - SYNC %s\n",
! 					 last_actseq_buf, PQgetvalue(res, 0, 0));
  			PQclear(res);
  
  			/*
--- 142,150 ----
  				break;
  			}
  			slon_log(SLON_DEBUG2,
! 					 "syncThread: new sl_action_seq %s - SYNC %s (old seq = %s, timeout = %d)\n",
! 					 last_actseq_buf, PQgetvalue(res, 0, 0), old_seq, timeout_count);
!             free(old_seq);
  			PQclear(res);
  
  			/*
diff -rN -c old-slony1-engine/src/xxid/Makefile new-slony1-engine-1/src/xxid/Makefile
*** old-slony1-engine/src/xxid/Makefile	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/xxid/Makefile	2005-08-26 16:24:50.000000000 +1000
***************
*** 11,17 ****
  slony_top_builddir = ../..
  include $(slony_top_builddir)/Makefile.global
  override CFLAGS += $(CFLAGS_SL)
! override CFLAGS += -I$(slony_top_builddir)
  
  NAME		= xxid
  
--- 11,17 ----
  slony_top_builddir = ../..
  include $(slony_top_builddir)/Makefile.global
  override CFLAGS += $(CFLAGS_SL)
! override CFLAGS += -I$(slony_top_builddir) -I$(slony_top_builddir)/src/backend
  
  NAME		= xxid
  
diff -rN -c old-slony1-engine/src/xxid/xxid.c new-slony1-engine-1/src/xxid/xxid.c
*** old-slony1-engine/src/xxid/xxid.c	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/xxid/xxid.c	2005-08-26 16:24:50.000000000 +1000
***************
*** 19,64 ****
  #include "access/transam.h"
  #include "executor/spi.h"
  
! 
! #ifndef PG_GETARG_TRANSACTIONID
! #define PG_GETARG_TRANSACTIONID(n)	DatumGetTransactionId(PG_GETARG_DATUM(n))
! #endif
! #ifndef PG_RETURN_TRANSACTIONID
! #define PG_RETURN_TRANSACTIONID(x)	return TransactionIdGetDatum(x)
! #endif
! 
  
  typedef struct
  {
  	int32		varsz;
! 	TransactionId xmin;
! 	TransactionId xmax;
  	int			nxip;
! 	TransactionId xip[1];
  }	xxid_snapshot;
  
  
- PG_FUNCTION_INFO_V1(_Slony_I_xxidin);
- PG_FUNCTION_INFO_V1(_Slony_I_xxidout);
- PG_FUNCTION_INFO_V1(_Slony_I_xxideq);
- PG_FUNCTION_INFO_V1(_Slony_I_xxidne);
- PG_FUNCTION_INFO_V1(_Slony_I_xxidlt);
- PG_FUNCTION_INFO_V1(_Slony_I_xxidle);
- PG_FUNCTION_INFO_V1(_Slony_I_xxidgt);
- PG_FUNCTION_INFO_V1(_Slony_I_xxidge);
- PG_FUNCTION_INFO_V1(_Slony_I_btxxidcmp);
  PG_FUNCTION_INFO_V1(_Slony_I_getCurrentXid);
  PG_FUNCTION_INFO_V1(_Slony_I_getMinXid);
  PG_FUNCTION_INFO_V1(_Slony_I_getMaxXid);
- Datum		_Slony_I_xxidin(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxidout(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxideq(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxidne(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxidlt(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxidle(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxidgt(PG_FUNCTION_ARGS);
- Datum		_Slony_I_xxidge(PG_FUNCTION_ARGS);
- Datum		_Slony_I_btxxidcmp(PG_FUNCTION_ARGS);
  Datum		_Slony_I_getCurrentXid(PG_FUNCTION_ARGS);
  Datum		_Slony_I_getMinXid(PG_FUNCTION_ARGS);
  Datum		_Slony_I_getMaxXid(PG_FUNCTION_ARGS);
--- 19,39 ----
  #include "access/transam.h"
  #include "executor/spi.h"
  
! #include "esm.h"
  
  typedef struct
  {
  	int32		varsz;
! 	ESMTransactionId xmin;
! 	ESMTransactionId xmax;
  	int			nxip;
! 	ESMTransactionId xip[1];
  }	xxid_snapshot;
  
  
  PG_FUNCTION_INFO_V1(_Slony_I_getCurrentXid);
  PG_FUNCTION_INFO_V1(_Slony_I_getMinXid);
  PG_FUNCTION_INFO_V1(_Slony_I_getMaxXid);
  Datum		_Slony_I_getCurrentXid(PG_FUNCTION_ARGS);
  Datum		_Slony_I_getMinXid(PG_FUNCTION_ARGS);
  Datum		_Slony_I_getMaxXid(PG_FUNCTION_ARGS);
***************
*** 75,221 ****
  
  
  /*
-  *		xxidin			- data input function for type _Slony_I_xxid
-  */
- Datum
- _Slony_I_xxidin(PG_FUNCTION_ARGS)
- {
- 	char	   *str = PG_GETARG_CSTRING(0);
- 
- 	PG_RETURN_TRANSACTIONID((TransactionId) strtoul(str, NULL, 0));
- }
- 
- 
- /*
-  *		xxidout			- data output function for type _Slony_I_xxid
-  */
- Datum
- _Slony_I_xxidout(PG_FUNCTION_ARGS)
- {
- 	TransactionId value = PG_GETARG_TRANSACTIONID(0);
- 	char	   *str = palloc(11);
- 
- 	snprintf(str, 11, "%lu", (unsigned long)value);
- 
- 	PG_RETURN_CSTRING(str);
- }
- 
- 
- /*
-  *		xxideq			- is value1 = value2 ?
-  */
- Datum
- _Slony_I_xxideq(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	PG_RETURN_BOOL(TransactionIdEquals(value1, value2));
- }
- 
- 
- /*
-  *		xxidne			- is value1 <> value2 ?
-  */
- Datum
- _Slony_I_xxidne(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	PG_RETURN_BOOL(!TransactionIdEquals(value1, value2));
- }
- 
- 
- /*
-  *		xxidlt			- is value1 < value2 ?
-  */
- Datum
- _Slony_I_xxidlt(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	if (TransactionIdEquals(value1, value2))
- 		PG_RETURN_BOOL(false);
- 
- 	PG_RETURN_BOOL(TransactionIdPrecedes(value1, value2));
- }
- 
- 
- /*
-  *		xxidle			- is value1 <= value2 ?
-  */
- Datum
- _Slony_I_xxidle(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	if (TransactionIdEquals(value1, value2))
- 		PG_RETURN_BOOL(true);
- 
- 	PG_RETURN_BOOL(TransactionIdPrecedesOrEquals(value1, value2));
- }
- 
- 
- /*
-  *		xxidgt			- is value1 > value2 ?
-  */
- Datum
- _Slony_I_xxidgt(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	if (TransactionIdEquals(value1, value2))
- 		PG_RETURN_BOOL(false);
- 
- 	PG_RETURN_BOOL(TransactionIdFollows(value1, value2));
- }
- 
- 
- /*
-  *		xxidge			- is value1 >= value2 ?
-  */
- Datum
- _Slony_I_xxidge(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	if (TransactionIdEquals(value1, value2))
- 		PG_RETURN_BOOL(true);
- 
- 	PG_RETURN_BOOL(TransactionIdFollowsOrEquals(value1, value2));
- }
- 
- 
- /*
-  *		btxxidcmp		- Three state compare
-  */
- Datum
- _Slony_I_btxxidcmp(PG_FUNCTION_ARGS)
- {
- 	TransactionId value1 = PG_GETARG_TRANSACTIONID(0);
- 	TransactionId value2 = PG_GETARG_TRANSACTIONID(1);
- 
- 	if (TransactionIdEquals(value1, value2))
- 		PG_RETURN_INT32(0);
- 
- 	if (TransactionIdPrecedes(value1, value2))
- 		PG_RETURN_INT32(-1);
- 	PG_RETURN_INT32(1);
- }
- 
- 
- /*
   *		getCurrentXid	- Return the current transaction ID as xxid
   */
  Datum
  _Slony_I_getCurrentXid(PG_FUNCTION_ARGS)
  {
! 	PG_RETURN_TRANSACTIONID(GetTopTransactionId());
  }
  
  
--- 50,61 ----
  
  
  /*
   *		getCurrentXid	- Return the current transaction ID as xxid
   */
  Datum
  _Slony_I_getCurrentXid(PG_FUNCTION_ARGS)
  {
! 	PG_RETURN_INT64(xid_to_uint64(CurrentTransactionState->tran_id));
  }
  
  
***************
*** 225,234 ****
  Datum
  _Slony_I_getMinXid(PG_FUNCTION_ARGS)
  {
  	if (SerializableSnapshot == NULL)
  		elog(ERROR, "Slony-I: SerializableSnapshot is NULL in getMinXid()");
  
! 	PG_RETURN_TRANSACTIONID(SerializableSnapshot->xmin);
  }
  
  
--- 65,76 ----
  Datum
  _Slony_I_getMinXid(PG_FUNCTION_ARGS)
  {
+ 	ESM_snapshot ss;
  	if (SerializableSnapshot == NULL)
  		elog(ERROR, "Slony-I: SerializableSnapshot is NULL in getMinXid()");
  
! 	ss = (ESM_snapshot) SerializableSnapshot->snapshot_desc->snapshot_id;
!     PG_RETURN_INT64(xid_to_uint64(ss->tranid[0]));
  }
  
  
***************
*** 238,250 ****
  Datum
  _Slony_I_getMaxXid(PG_FUNCTION_ARGS)
  {
  	if (SerializableSnapshot == NULL)
  		elog(ERROR, "Slony-I: SerializableSnapshot is NULL in getMaxXid()");
  
! 	PG_RETURN_TRANSACTIONID(SerializableSnapshot->xmax);
  }
  
- 
  /*
   *		xxid_snapshot_in	- input function for type xxid_snapshot
   */
--- 80,94 ----
  Datum
  _Slony_I_getMaxXid(PG_FUNCTION_ARGS)
  {
+ 	ESM_snapshot ss;
+ 
  	if (SerializableSnapshot == NULL)
  		elog(ERROR, "Slony-I: SerializableSnapshot is NULL in getMaxXid()");
  
! 	ss = (ESM_snapshot) SerializableSnapshot->snapshot_desc->snapshot_id;
!     PG_RETURN_INT64(xid_to_uint64(ss->next_tranid));
  }
  
  /*
   *		xxid_snapshot_in	- input function for type xxid_snapshot
   */
***************
*** 252,262 ****
  _Slony_I_xxid_snapshot_in(PG_FUNCTION_ARGS)
  {
  	static int	a_size = 0;
! 	static TransactionId *xip = NULL;
  
  	int			a_used = 0;
! 	TransactionId xmin;
! 	TransactionId xmax;
  	xxid_snapshot *snap;
  	int			size;
  
--- 96,106 ----
  _Slony_I_xxid_snapshot_in(PG_FUNCTION_ARGS)
  {
  	static int	a_size = 0;
! 	static ESMTransactionId *xip = NULL;
  
  	int			a_used = 0;
! 	ESMTransactionId xmin;
! 	ESMTransactionId xmax;
  	xxid_snapshot *snap;
  	int			size;
  
***************
*** 266,282 ****
  	if (a_size == 0)
  	{
  		a_size = 4096;
! 		xip = (TransactionId *) malloc(sizeof(TransactionId) * a_size);
  		if (xip == NULL)
  			elog(ERROR, "Out of memory in xxid_snapshot_in");
  	}
  
! 	xmin = (TransactionId) strtoul(str, &endp, 0);
  	if (*endp != ':')
  		elog(ERROR, "illegal xxid_snapshot input format");
  	str = endp + 1;
  
! 	xmax = (TransactionId) strtoul(str, &endp, 0);
  	if (*endp != ':')
  		elog(ERROR, "illegal xxid_snapshot input format");
  	str = endp + 1;
--- 110,126 ----
  	if (a_size == 0)
  	{
  		a_size = 4096;
! 		xip = (ESMTransactionId *) malloc(sizeof(ESMTransactionId) * a_size);
  		if (xip == NULL)
  			elog(ERROR, "Out of memory in xxid_snapshot_in");
  	}
  
! 	xmin = (ESMTransactionId) strtoull(str, &endp, 0);
  	if (*endp != ':')
  		elog(ERROR, "illegal xxid_snapshot input format");
  	str = endp + 1;
  
! 	xmax = (ESMTransactionId) strtoull(str, &endp, 0);
  	if (*endp != ':')
  		elog(ERROR, "illegal xxid_snapshot input format");
  	str = endp + 1;
***************
*** 286,292 ****
  		if (a_used >= a_size)
  		{
  			a_size *= 2;
! 			xip = (TransactionId *) realloc(xip, sizeof(TransactionId) * a_size);
  			if (xip == NULL)
  				elog(ERROR, "Out of memory in xxid_snapshot_in");
  		}
--- 130,136 ----
  		if (a_used >= a_size)
  		{
  			a_size *= 2;
! 			xip = (ESMTransactionId *) realloc(xip, sizeof(ESMTransactionId) * a_size);
  			if (xip == NULL)
  				elog(ERROR, "Out of memory in xxid_snapshot_in");
  		}
***************
*** 294,307 ****
  		if (*str == '\'')
  		{
  			str++;
! 			xip[a_used++] = (TransactionId) strtoul(str, &endp, 0);
  			if (*endp != '\'')
  				elog(ERROR, "illegal xxid_snapshot input format");
  			str = endp + 1;
  		}
  		else
  		{
! 			xip[a_used++] = (TransactionId) strtoul(str, &endp, 0);
  			str = endp;
  		}
  		if (*str == ',')
--- 138,151 ----
  		if (*str == '\'')
  		{
  			str++;
! 			xip[a_used++] = (ESMTransactionId) strtoull(str, &endp, 0);
  			if (*endp != '\'')
  				elog(ERROR, "illegal xxid_snapshot input format");
  			str = endp + 1;
  		}
  		else
  		{
! 			xip[a_used++] = (ESMTransactionId) strtoull(str, &endp, 0);
  			str = endp;
  		}
  		if (*str == ',')
***************
*** 313,326 ****
  		}
  	}
  
! 	size = offsetof(xxid_snapshot, xip) + sizeof(TransactionId) * a_used;
  	snap = (xxid_snapshot *) palloc(size);
  	snap->varsz = size;
  	snap->xmin = xmin;
  	snap->xmax = xmax;
  	snap->nxip = a_used;
  	if (a_used > 0)
! 		memcpy(&(snap->xip[0]), xip, sizeof(TransactionId) * a_used);
  
  	PG_RETURN_POINTER(snap);
  }
--- 157,170 ----
  		}
  	}
  
! 	size = offsetof(xxid_snapshot, xip) + sizeof(ESMTransactionId) * a_used;
  	snap = (xxid_snapshot *) palloc(size);
  	snap->varsz = size;
  	snap->xmin = xmin;
  	snap->xmax = xmax;
  	snap->nxip = a_used;
  	if (a_used > 0)
! 		memcpy(&(snap->xip[0]), xip, sizeof(ESMTransactionId) * a_used);
  
  	PG_RETURN_POINTER(snap);
  }
***************
*** 334,350 ****
  {
  	xxid_snapshot *snap = (xxid_snapshot *) PG_GETARG_VARLENA_P(0);
  
! 	char	   *str = palloc(28 + snap->nxip * 13);
  	char	   *cp = str;
  	int			i;
  
! 	snprintf(str, 26, "%lu:%lu:", (unsigned long)snap->xmin,
! 			 (unsigned long)snap->xmax);
  	cp = str + strlen(str);
  
  	for (i = 0; i < snap->nxip; i++)
  	{
! 		snprintf(cp, 13, "%lu%s", (unsigned long)snap->xip[i],
  				 (i < snap->nxip - 1) ? "," : "");
  		cp += strlen(cp);
  	}
--- 178,193 ----
  {
  	xxid_snapshot *snap = (xxid_snapshot *) PG_GETARG_VARLENA_P(0);
  
! 	char	   *str = palloc(28 + snap->nxip * 23);
  	char	   *cp = str;
  	int			i;
  
! 	snprintf(str, 26, "%llu:%llu:", snap->xmin, snap->xmax);
  	cp = str + strlen(str);
  
  	for (i = 0; i < snap->nxip; i++)
  	{
! 		snprintf(cp, 23, "%llu%s", snap->xip[i],
  				 (i < snap->nxip - 1) ? "," : "");
  		cp += strlen(cp);
  	}
***************
*** 359,377 ****
  Datum
  _Slony_I_xxid_lt_snapshot(PG_FUNCTION_ARGS)
  {
! 	TransactionId value = PG_GETARG_TRANSACTIONID(0);
  	xxid_snapshot *snap = (xxid_snapshot *) PG_GETARG_VARLENA_P(1);
  	int			i;
  
! 	if (TransactionIdPrecedes(value, snap->xmin))
  		PG_RETURN_BOOL(true);
  
! 	if (!TransactionIdPrecedes(value, snap->xmax))
  		PG_RETURN_BOOL(false);
  
  	for (i = 0; i < snap->nxip; i++)
  	{
! 		if (TransactionIdEquals(value, snap->xip[i]))
  			PG_RETURN_BOOL(false);
  	}
  
--- 202,220 ----
  Datum
  _Slony_I_xxid_lt_snapshot(PG_FUNCTION_ARGS)
  {
! 	ESMTransactionId value = PG_GETARG_INT64(0);
  	xxid_snapshot *snap = (xxid_snapshot *) PG_GETARG_VARLENA_P(1);
  	int			i;
  
! 	if (value < snap->xmin)
  		PG_RETURN_BOOL(true);
  
! 	if (value >= snap->xmax)
  		PG_RETURN_BOOL(false);
  
  	for (i = 0; i < snap->nxip; i++)
  	{
! 		if (value == snap->xip[i])
  			PG_RETURN_BOOL(false);
  	}
  
***************
*** 385,405 ****
  Datum
  _Slony_I_xxid_ge_snapshot(PG_FUNCTION_ARGS)
  {
! 	TransactionId value = PG_GETARG_TRANSACTIONID(0);
  	xxid_snapshot *snap = (xxid_snapshot *) PG_GETARG_VARLENA_P(1);
  	int			i;
  
! 	if (TransactionIdEquals(value, snap->xmax))
! 		PG_RETURN_BOOL(true);
! 	if (TransactionIdFollowsOrEquals(value, snap->xmax))
  		PG_RETURN_BOOL(true);
  
! 	if (TransactionIdPrecedes(value, snap->xmin))
  		PG_RETURN_BOOL(false);
  
  	for (i = 0; i < snap->nxip; i++)
  	{
! 		if (TransactionIdEquals(value, snap->xip[i]))
  			PG_RETURN_BOOL(true);
  	}
  
--- 228,246 ----
  Datum
  _Slony_I_xxid_ge_snapshot(PG_FUNCTION_ARGS)
  {
! 	ESMTransactionId value = PG_GETARG_INT64(0);
  	xxid_snapshot *snap = (xxid_snapshot *) PG_GETARG_VARLENA_P(1);
  	int			i;
  
! 	if (value >= snap->xmax)
  		PG_RETURN_BOOL(true);
  
! 	if (value < snap->xmin)
  		PG_RETURN_BOOL(false);
  
  	for (i = 0; i < snap->nxip; i++)
  	{
! 		if (value == snap->xip[i])
  			PG_RETURN_BOOL(true);
  	}
  
diff -rN -c old-slony1-engine/src/xxid/xxid.v73.sql new-slony1-engine-1/src/xxid/xxid.v73.sql
*** old-slony1-engine/src/xxid/xxid.v73.sql	2005-08-26 16:24:23.000000000 +1000
--- new-slony1-engine-1/src/xxid/xxid.v73.sql	2005-08-26 16:24:50.000000000 +1000
***************
*** 10,72 ****
  -- ----------
  
  --
- -- Type specific input and output functions
- --
- CREATE FUNCTION @NAMESPACE@."xxidin"(cstring) RETURNS @NAMESPACE@."xxid"
- 	AS '$libdir/xxid', '_Slony_I_xxidin'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."xxidout"(@NAMESPACE@."xxid") RETURNS cstring
- 	AS '$libdir/xxid', '_Slony_I_xxidout'
- 	LANGUAGE C;
- 
- 
- --
  -- The data type itself
  --
! CREATE TYPE @NAMESPACE@."xxid" (
! 	INPUT = @NAMESPACE@."xxidin",
! 	OUTPUT = @NAMESPACE@."xxidout",
! 	EXTERNALLENGTH = 12,
! 	INTERNALLENGTH = 4,
! 	PASSEDBYVALUE,
! 	ALIGNMENT = int4
! );
  
  
- --
- -- Since our xxid type has special cases for values 0-3, it
- -- in fact IS xid, so allow implicit type casting to and from.
- --
- CREATE CAST (xid AS @NAMESPACE@.xxid)
- 	WITHOUT FUNCTION AS IMPLICIT;
- CREATE CAST (@NAMESPACE@.xxid AS xid)
- 	WITHOUT FUNCTION AS IMPLICIT;
- 
- 
- --
- -- Comparision functions for the new datatype
- --
- CREATE FUNCTION @NAMESPACE@."xxideq"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS boolean
- 	AS '$libdir/xxid', '_Slony_I_xxideq'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."xxidne"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS boolean
- 	AS '$libdir/xxid', '_Slony_I_xxidne'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."xxidlt"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS boolean
- 	AS '$libdir/xxid', '_Slony_I_xxidlt'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."xxidle"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS boolean
- 	AS '$libdir/xxid', '_Slony_I_xxidle'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."xxidgt"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS boolean
- 	AS '$libdir/xxid', '_Slony_I_xxidgt'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."xxidge"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS boolean
- 	AS '$libdir/xxid', '_Slony_I_xxidge'
- 	LANGUAGE C;
- CREATE FUNCTION @NAMESPACE@."btxxidcmp"(@NAMESPACE@."xxid", @NAMESPACE@."xxid") RETURNS int4
- 	AS '$libdir/xxid', '_Slony_I_btxxidcmp'
- 	LANGUAGE C;
  CREATE FUNCTION @NAMESPACE@.getCurrentXid() RETURNS @NAMESPACE@."xxid"
  	AS '$libdir/xxid', '_Slony_I_getCurrentXid'
  	LANGUAGE C;
--- 10,20 ----
  -- ----------
  
  --
  -- The data type itself
  --
! CREATE DOMAIN @NAMESPACE@."xxid" as int8;
  
  
  CREATE FUNCTION @NAMESPACE@.getCurrentXid() RETURNS @NAMESPACE@."xxid"
  	AS '$libdir/xxid', '_Slony_I_getCurrentXid'
  	LANGUAGE C;
***************
*** 77,145 ****
  	AS '$libdir/xxid', '_Slony_I_getMaxXid'
  	LANGUAGE C;
  
- 
- --
- -- Operators on these comparision functions
- --
- CREATE OPERATOR < (
- 	PROCEDURE = @NAMESPACE@."xxidlt",
- 	LEFTARG = @NAMESPACE@."xxid",
- 	RIGHTARG = @NAMESPACE@."xxid",
- 	COMMUTATOR = >, NEGATOR = >=,
- 	RESTRICT = scalarltsel, JOIN = scalarltjoinsel
- );
- CREATE OPERATOR = (
- 	PROCEDURE = @NAMESPACE@."xxideq",
- 	LEFTARG = @NAMESPACE@."xxid",
- 	RIGHTARG = @NAMESPACE@."xxid",
- 	COMMUTATOR = =, NEGATOR = <>,
- 	RESTRICT = eqsel, JOIN = eqjoinsel,
- 	SORT1 = <, SORT2 = <
- );
- CREATE OPERATOR <> (
- 	PROCEDURE = @NAMESPACE@."xxidne",
- 	LEFTARG = @NAMESPACE@."xxid",
- 	RIGHTARG = @NAMESPACE@."xxid",
- 	COMMUTATOR = <>, NEGATOR = =,
- 	RESTRICT = neqsel, JOIN = neqjoinsel
- );
- CREATE OPERATOR > (
- 	PROCEDURE = @NAMESPACE@."xxidgt",
- 	LEFTARG = @NAMESPACE@."xxid",
- 	RIGHTARG = @NAMESPACE@."xxid",
- 	COMMUTATOR = <, NEGATOR = <=,
- 	RESTRICT = scalargtsel, JOIN = scalargtjoinsel
- );
- CREATE OPERATOR <= (
- 	PROCEDURE = @NAMESPACE@."xxidle",
- 	LEFTARG = @NAMESPACE@."xxid",
- 	RIGHTARG = @NAMESPACE@."xxid",
- 	COMMUTATOR = >=, NEGATOR = >,
- 	RESTRICT = scalarltsel, JOIN = scalarltjoinsel
- );
- CREATE OPERATOR >= (
- 	PROCEDURE = @NAMESPACE@."xxidge",
- 	LEFTARG = @NAMESPACE@."xxid",
- 	RIGHTARG = @NAMESPACE@."xxid",
- 	COMMUTATOR = <=, NEGATOR = <,
- 	RESTRICT = scalargtsel, JOIN = scalargtjoinsel
- );
- 
- 
- --
- -- Finally the default operator class so that we can use our
- -- new data type in btree indexes.
- --
- CREATE OPERATOR CLASS @NAMESPACE@."xxid_ops"
- 	DEFAULT FOR TYPE @NAMESPACE@."xxid" USING btree AS
- 	OPERATOR 1 <  (@NAMESPACE@."xxid", @NAMESPACE@."xxid"),
- 	OPERATOR 2 <= (@NAMESPACE@."xxid", @NAMESPACE@."xxid"),
- 	OPERATOR 3 =  (@NAMESPACE@."xxid", @NAMESPACE@."xxid"),
- 	OPERATOR 4 >= (@NAMESPACE@."xxid", @NAMESPACE@."xxid"),
- 	OPERATOR 5 >  (@NAMESPACE@."xxid", @NAMESPACE@."xxid"),
- 	FUNCTION 1 @NAMESPACE@."btxxidcmp" (@NAMESPACE@."xxid", @NAMESPACE@."xxid");
- 
- 
  --
  -- A special transaction snapshot data type for faster visibility checks
  --
--- 25,30 ----
***************
*** 152,158 ****
  	AS '$libdir/xxid', '_Slony_I_xxid_snapshot_out'
  	LANGUAGE C;
  
- 
  --
  -- The data type itself
  --
--- 37,42 ----

