mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Allow float8, int8, and related datatypes to be passed by value on machines
where Datum is 8 bytes wide. Since this will break old-style C functions (those still using version 0 calling convention) that have arguments or results of these types, provide a configure option to disable it and retain the old pass-by-reference behavior. Likewise, provide a configure option to disable the recently-committed float4 pass-by-value change. Zoltan Boszormenyi, plus configurability stuff by me.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.297 2008/04/16 23:59:40 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.298 2008/04/21 00:26:44 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3791,10 +3791,12 @@ WriteControlFile(void)
|
||||
ControlFile->toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
|
||||
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
ControlFile->enableIntTimes = TRUE;
|
||||
ControlFile->enableIntTimes = true;
|
||||
#else
|
||||
ControlFile->enableIntTimes = FALSE;
|
||||
ControlFile->enableIntTimes = false;
|
||||
#endif
|
||||
ControlFile->float4ByVal = FLOAT4PASSBYVAL;
|
||||
ControlFile->float8ByVal = FLOAT8PASSBYVAL;
|
||||
|
||||
ControlFile->localeBuflen = LOCALE_NAME_BUFLEN;
|
||||
localeptr = setlocale(LC_COLLATE, NULL);
|
||||
@ -4000,14 +4002,14 @@ ReadControlFile(void)
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
if (ControlFile->enableIntTimes != TRUE)
|
||||
if (ControlFile->enableIntTimes != true)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
errdetail("The database cluster was initialized without HAVE_INT64_TIMESTAMP"
|
||||
" but the server was compiled with HAVE_INT64_TIMESTAMP."),
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
#else
|
||||
if (ControlFile->enableIntTimes != FALSE)
|
||||
if (ControlFile->enableIntTimes != false)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
errdetail("The database cluster was initialized with HAVE_INT64_TIMESTAMP"
|
||||
@ -4015,6 +4017,38 @@ ReadControlFile(void)
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
#endif
|
||||
|
||||
#ifdef USE_FLOAT4_BYVAL
|
||||
if (ControlFile->float4ByVal != true)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
errdetail("The database cluster was initialized without USE_FLOAT4_BYVAL"
|
||||
" but the server was compiled with USE_FLOAT4_BYVAL."),
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
#else
|
||||
if (ControlFile->float4ByVal != false)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
errdetail("The database cluster was initialized with USE_FLOAT4_BYVAL"
|
||||
" but the server was compiled without USE_FLOAT4_BYVAL."),
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
#endif
|
||||
|
||||
#ifdef USE_FLOAT8_BYVAL
|
||||
if (ControlFile->float8ByVal != true)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
errdetail("The database cluster was initialized without USE_FLOAT8_BYVAL"
|
||||
" but the server was compiled with USE_FLOAT8_BYVAL."),
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
#else
|
||||
if (ControlFile->float8ByVal != false)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
errdetail("The database cluster was initialized with USE_FLOAT8_BYVAL"
|
||||
" but the server was compiled without USE_FLOAT8_BYVAL."),
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
#endif
|
||||
|
||||
if (ControlFile->localeBuflen != LOCALE_NAME_BUFLEN)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with server"),
|
||||
|
Reference in New Issue
Block a user