From 64eea6c21d5ad64753f3564862572951f80d5c92 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 3 Oct 2005 00:28:43 +0000 Subject: Expand pg_control information so that we can verify that the database was created on a machine with alignment rules and floating-point format similar to the current machine. Per recent discussion, this seems like a good idea with the increasing prevalence of 32/64 bit environments. --- src/include/catalog/pg_control.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/include/catalog') diff --git a/src/include/catalog/pg_control.h b/src/include/catalog/pg_control.h index 73f32b55ad..158a4ee92b 100644 --- a/src/include/catalog/pg_control.h +++ b/src/include/catalog/pg_control.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.23 2005/06/08 15:50:28 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.24 2005/10/03 00:28:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,7 @@ /* Version identifier for this pg_control format */ -#define PG_CONTROL_VERSION 811 +#define PG_CONTROL_VERSION 812 /* * Body of CheckPoint XLOG records. This is declared here because we keep @@ -107,6 +107,22 @@ typedef struct ControlFileData CheckPoint checkPointCopy; /* copy of last check point record */ + /* + * This data is used to check for hardware-architecture compatibility + * of the database and the backend executable. We need not check + * endianness explicitly, since the pg_control version will surely + * look wrong to a machine of different endianness, but we do need + * to worry about MAXALIGN and floating-point format. (Note: storage + * layout nominally also depends on SHORTALIGN and INTALIGN, but in + * practice these are the same on all architectures of interest.) + * + * Testing just one double value is not a very bulletproof test for + * floating-point compatibility, but it will catch most cases. + */ + uint32 maxAlign; /* alignment requirement for tuples */ + double floatFormat; /* constant 1234567.0 */ +#define FLOATFORMAT_VALUE 1234567.0 + /* * This data is used to make sure that configuration of this database * is compatible with the backend executable. -- cgit v1.2.1