summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorPeter Eisentraut2019-11-21 17:00:07 +0000
committerPeter Eisentraut2019-11-21 17:29:21 +0000
commit2e4db241bfd3206bad8286f8ffc2db6bbdaefcdf (patch)
tree709eee963e46e556e7f6e54a2eceba236e816a9e /src/backend/utils
parent43a54a3bccd7dc6be798475214d561f3e93b3055 (diff)
Remove configure --disable-float4-byval
This build option was only useful to maintain compatibility for version-0 functions, but those are no longer supported, so this option can be removed. float4 is now always pass-by-value; the pass-by-reference code path is completely removed. Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/fmgr/dfmgr.c9
-rw-r--r--src/backend/utils/fmgr/fmgr.c19
-rw-r--r--src/backend/utils/misc/pg_controldata.c17
3 files changed, 8 insertions, 37 deletions
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index c8d2cef35ff..37992ffd448 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -365,15 +365,6 @@ incompatible_module_error(const char *libname,
magic_data.namedatalen,
module_magic_data->namedatalen);
}
- if (module_magic_data->float4byval != magic_data.float4byval)
- {
- if (details.len)
- appendStringInfoChar(&details, '\n');
- appendStringInfo(&details,
- _("Server has FLOAT4PASSBYVAL = %s, library has %s."),
- magic_data.float4byval ? "true" : "false",
- module_magic_data->float4byval ? "true" : "false");
- }
if (module_magic_data->float8byval != magic_data.float8byval)
{
if (details.len)
diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c
index 099ebd779ba..2ce7a866c90 100644
--- a/src/backend/utils/fmgr/fmgr.c
+++ b/src/backend/utils/fmgr/fmgr.c
@@ -1683,7 +1683,7 @@ OidSendFunctionCall(Oid functionId, Datum val)
/*-------------------------------------------------------------------------
* Support routines for standard maybe-pass-by-reference datatypes
*
- * int8, float4, and float8 can be passed by value if Datum is wide enough.
+ * int8 and float8 can be passed by value if Datum is wide enough.
* (For backwards-compatibility reasons, we allow pass-by-ref to be chosen
* at compile time even if pass-by-val is possible.)
*
@@ -1703,21 +1703,6 @@ Int64GetDatum(int64 X)
*retval = X;
return PointerGetDatum(retval);
}
-#endif /* USE_FLOAT8_BYVAL */
-
-#ifndef USE_FLOAT4_BYVAL
-
-Datum
-Float4GetDatum(float4 X)
-{
- float4 *retval = (float4 *) palloc(sizeof(float4));
-
- *retval = X;
- return PointerGetDatum(retval);
-}
-#endif
-
-#ifndef USE_FLOAT8_BYVAL
Datum
Float8GetDatum(float8 X)
@@ -1727,7 +1712,7 @@ Float8GetDatum(float8 X)
*retval = X;
return PointerGetDatum(retval);
}
-#endif
+#endif /* USE_FLOAT8_BYVAL */
/*-------------------------------------------------------------------------
diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c
index 3d0916fea70..7007d6503f8 100644
--- a/src/backend/utils/misc/pg_controldata.c
+++ b/src/backend/utils/misc/pg_controldata.c
@@ -264,8 +264,8 @@ pg_control_recovery(PG_FUNCTION_ARGS)
Datum
pg_control_init(PG_FUNCTION_ARGS)
{
- Datum values[12];
- bool nulls[12];
+ Datum values[11];
+ bool nulls[11];
TupleDesc tupdesc;
HeapTuple htup;
ControlFileData *ControlFile;
@@ -294,11 +294,9 @@ pg_control_init(PG_FUNCTION_ARGS)
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 9, "large_object_chunk_size",
INT4OID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float4_pass_by_value",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float8_pass_by_value",
BOOLOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 11, "float8_pass_by_value",
- BOOLOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 12, "data_page_checksum_version",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 11, "data_page_checksum_version",
INT4OID, -1, 0);
tupdesc = BlessTupleDesc(tupdesc);
@@ -335,15 +333,12 @@ pg_control_init(PG_FUNCTION_ARGS)
values[8] = Int32GetDatum(ControlFile->loblksize);
nulls[8] = false;
- values[9] = BoolGetDatum(ControlFile->float4ByVal);
+ values[9] = BoolGetDatum(ControlFile->float8ByVal);
nulls[9] = false;
- values[10] = BoolGetDatum(ControlFile->float8ByVal);
+ values[10] = Int32GetDatum(ControlFile->data_checksum_version);
nulls[10] = false;
- values[11] = Int32GetDatum(ControlFile->data_checksum_version);
- nulls[11] = false;
-
htup = heap_form_tuple(tupdesc, values, nulls);
PG_RETURN_DATUM(HeapTupleGetDatum(htup));