Thu Apr 26 08:24:23 PDT 2007
- Previous message: [Slony1-patches] Patch that allows log shipping to work
- Next message: [Slony1-patches] PostgreSQL 8.3 compatibilty
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
As discussed on slony1-hackers, this patch updates -HEAD for =
compatibility with PostgreSQL -HEAD. It's quite simple, so I think it =
should be back patched to 1.2.x so we have something to release with =
PostgreSQL 8.3 - I'll produce another patch if everyone is happy.
Autoconf should be re-run when the patch is applied. I don't have CVS =
write access yet so I can't commit this...
Regards, Dave
-------------- next part --------------
Index: Makefile.global.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /slony1/slony1-engine/Makefile.global.in,v
retrieving revision 1.35
diff -c -r1.35 Makefile.global.in
*** Makefile.global.in 26 Oct 2006 19:07:18 -0000 1.35
--- Makefile.global.in 26 Apr 2007 15:17:38 -0000
***************
*** 9,14 ****
--- 9,19 ----
# $Id: Makefile.global.in,v 1.35 2006-10-26 19:07:18 wieck Exp $
# ----------
=
+ # PostgreSQL Version
+ PG_VERSION_MAJOR=3D @PG_VERSION_MAJOR@
+ PG_VERSION_MINOR=3D @PG_VERSION_MINOR@
+ PG_VERSION=3D @PG_VERSION@
+ =
#location substitutions
=
pgincludedir=3D @PGINCLUDEDIR@
Index: configure.ac
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /slony1/slony1-engine/configure.ac,v
retrieving revision 1.60
diff -c -r1.60 configure.ac
*** configure.ac 20 Feb 2007 11:20:44 -0000 1.60
--- configure.ac 26 Apr 2007 15:17:38 -0000
***************
*** 162,167 ****
--- 162,171 ----
ACX_LIBSNMP()
ACX_SLONYTOOLS()
=
+ AC_SUBST(PG_VERSION_MAJOR, $PG_VERSION_MAJOR)
+ AC_SUBST(PG_VERSION_MINOR, $PG_VERSION_MINOR)
+ AC_SUBST(PG_VERSION, $PG_VERSION)
+ =
AC_SUBST(PGINCLUDEDIR, $PG_INCLUDEDIR)
AC_SUBST(PGINCLUDESERVERDIR, $PG_INCLUDESERVERDIR)
AC_SUBST(PGLIBDIR, $PG_LIBDIR)
Index: src/backend/slony1_funcs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /slony1/slony1-engine/src/backend/slony1_funcs.c,v
retrieving revision 1.59
diff -c -r1.59 slony1_funcs.c
*** src/backend/slony1_funcs.c 18 Apr 2007 21:20:22 -0000 1.59
--- src/backend/slony1_funcs.c 26 Apr 2007 15:17:39 -0000
***************
*** 44,51 ****
#endif
=
/* -- Change from PostgreSQL Ver 8.3 -- */
! #ifndef VARATT_SIZEP
! #define VARATT_SIZEP VARATT_SIZEP_DEPRECATED
#endif
=
PG_FUNCTION_INFO_V1(_Slony_I_createEvent);
--- 44,51 ----
#endif
=
/* -- Change from PostgreSQL Ver 8.3 -- */
! #if !((PG_VERSION_MAJOR >=3D 8) || ((PG_VERSION_MAJOR =3D=3D 8) && (PG_VE=
RSION_MINOR >=3D 3)))
! #define SET_VARSIZE(datum, size) (VARATT_SIZEP(datum)=3D(size))
#endif
=
PG_FUNCTION_INFO_V1(_Slony_I_createEvent);
***************
*** 310,316 ****
=
len =3D strlen(SLONY_I_VERSION_STRING);
retval =3D palloc(VARHDRSZ + len);
! VARATT_SIZEP(retval) =3D VARHDRSZ + len;
memcpy(VARDATA(retval), SLONY_I_VERSION_STRING, len);
=
PG_RETURN_TEXT_P(retval);
--- 310,317 ----
=
len =3D strlen(SLONY_I_VERSION_STRING);
retval =3D palloc(VARHDRSZ + len);
! =
! SET_VARSIZE(retval,VARHDRSZ + len);
memcpy(VARDATA(retval), SLONY_I_VERSION_STRING, len);
=
PG_RETURN_TEXT_P(retval);
***************
*** 383,401 ****
case SLON_ROLE_UNSET:
cs->session_role =3D SLON_ROLE_NORMAL;
retval =3D palloc(VARHDRSZ + 6);
! VARATT_SIZEP(retval) =3D VARHDRSZ + 6;
memcpy(VARDATA(retval), "normal", 6);
break;
=
case SLON_ROLE_NORMAL:
retval =3D palloc(VARHDRSZ + 6);
! VARATT_SIZEP(retval) =3D VARHDRSZ + 6;
memcpy(VARDATA(retval), "normal", 6);
break;
=
case SLON_ROLE_SLON:
retval =3D palloc(VARHDRSZ + 4);
! VARATT_SIZEP(retval) =3D VARHDRSZ + 4;
memcpy(VARDATA(retval), "slon", 4);
break;
}
--- 384,402 ----
case SLON_ROLE_UNSET:
cs->session_role =3D SLON_ROLE_NORMAL;
retval =3D palloc(VARHDRSZ + 6);
! SET_VARSIZE(retval, VARHDRSZ + 6);
memcpy(VARDATA(retval), "normal", 6);
break;
=
case SLON_ROLE_NORMAL:
retval =3D palloc(VARHDRSZ + 6);
! SET_VARSIZE(retval, VARHDRSZ + 6);
memcpy(VARDATA(retval), "normal", 6);
break;
=
case SLON_ROLE_SLON:
retval =3D palloc(VARHDRSZ + 4);
! SET_VARSIZE(retval, VARHDRSZ + 4);
memcpy(VARDATA(retval), "slon", 4);
break;
}
***************
*** 490,496 ****
elog(ERROR, "Slony-I: cannot determine log status");
if (SPI_processed !=3D 1)
elog(ERROR, "Slony-I: cannot determine log status");
! =
log_status =3D DatumGetInt32(SPI_getbinval(SPI_tuptable->vals[0],
SPI_tuptable->tupdesc, 1, NULL));
SPI_freetuptable(SPI_tuptable);
--- 491,497 ----
elog(ERROR, "Slony-I: cannot determine log status");
if (SPI_processed !=3D 1)
elog(ERROR, "Slony-I: cannot determine log status");
! =
log_status =3D DatumGetInt32(SPI_getbinval(SPI_tuptable->vals[0],
SPI_tuptable->tupdesc, 1, NULL));
SPI_freetuptable(SPI_tuptable);
***************
*** 636,643 ****
*/
*cp++ =3D ')';
*cp =3D '\0';
! VARATT_SIZEP(cs->cmddata_buf) =3D
! VARHDRSZ + (cp - VARDATA(cs->cmddata_buf));
}
else if (TRIGGER_FIRED_BY_UPDATE(tg->tg_event))
{
--- 637,644 ----
*/
*cp++ =3D ')';
*cp =3D '\0';
! SET_VARSIZE(cs->cmddata_buf, =
! VARHDRSZ + (cp - VARDATA(cs->cmddata_buf)));
}
else if (TRIGGER_FIRED_BY_UPDATE(tg->tg_event))
{
***************
*** 874,881 ****
cp +=3D len_value;
}
*cp =3D '\0';
! VARATT_SIZEP(cs->cmddata_buf) =3D
! VARHDRSZ + (cp - VARDATA(cs->cmddata_buf));
}
else if (TRIGGER_FIRED_BY_DELETE(tg->tg_event))
{
--- 875,882 ----
cp +=3D len_value;
}
*cp =3D '\0';
! SET_VARSIZE(cs->cmddata_buf,
! VARHDRSZ + (cp - VARDATA(cs->cmddata_buf)));
}
else if (TRIGGER_FIRED_BY_DELETE(tg->tg_event))
{
***************
*** 941,948 ****
cp +=3D len_value;
}
*cp =3D '\0';
! VARATT_SIZEP(cs->cmddata_buf) =3D
! VARHDRSZ + (cp - VARDATA(cs->cmddata_buf));
}
else
elog(ERROR, "Slony-I: logTrigger() fired for unhandled event");
--- 942,949 ----
cp +=3D len_value;
}
*cp =3D '\0';
! SET_VARSIZE(cs->cmddata_buf,
! VARHDRSZ + (cp - VARDATA(cs->cmddata_buf)));
}
else
elog(ERROR, "Slony-I: logTrigger() fired for unhandled event");
***************
*** 1250,1256 ****
=
len =3D strlen(qstr);
result =3D (text *) palloc(len + VARHDRSZ);
! VARATT_SIZEP(result) =3D len + VARHDRSZ;
memcpy(VARDATA(result), qstr, len);
=
PG_RETURN_TEXT_P(result);
--- 1251,1257 ----
=
len =3D strlen(qstr);
result =3D (text *) palloc(len + VARHDRSZ);
! SET_VARSIZE(result, len + VARHDRSZ);
memcpy(VARDATA(result), qstr, len);
=
PG_RETURN_TEXT_P(result);
***************
*** 1492,1504 ****
* parameter and initialize the cmddata_buf.
*/
cs->cmdtype_I =3D malloc(VARHDRSZ + 1);
! VARATT_SIZEP(cs->cmdtype_I) =3D VARHDRSZ + 1;
*VARDATA(cs->cmdtype_I) =3D 'I';
cs->cmdtype_U =3D malloc(VARHDRSZ + 1);
! VARATT_SIZEP(cs->cmdtype_U) =3D VARHDRSZ + 1;
*VARDATA(cs->cmdtype_U) =3D 'U';
cs->cmdtype_D =3D malloc(VARHDRSZ + 1);
! VARATT_SIZEP(cs->cmdtype_D) =3D VARHDRSZ + 1;
*VARDATA(cs->cmdtype_D) =3D 'D';
=
/*
--- 1493,1505 ----
* parameter and initialize the cmddata_buf.
*/
cs->cmdtype_I =3D malloc(VARHDRSZ + 1);
! SET_VARSIZE(cs->cmdtype_I, VARHDRSZ + 1);
*VARDATA(cs->cmdtype_I) =3D 'I';
cs->cmdtype_U =3D malloc(VARHDRSZ + 1);
! SET_VARSIZE(cs->cmdtype_U, VARHDRSZ + 1);
*VARDATA(cs->cmdtype_U) =3D 'U';
cs->cmdtype_D =3D malloc(VARHDRSZ + 1);
! SET_VARSIZE(cs->cmdtype_D, VARHDRSZ + 1);
*VARDATA(cs->cmdtype_D) =3D 'D';
=
/*
- Previous message: [Slony1-patches] Patch that allows log shipping to work
- Next message: [Slony1-patches] PostgreSQL 8.3 compatibilty
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-patches mailing list