[SCM] PostGIS branch master updated. 3.6.0rc2-523-g24e75f75b

git at osgeo.org git at osgeo.org
Wed Jun 10 15:20:20 PDT 2026


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  24e75f75b94ce51ce88fad7a4b9fadae12ae3ef3 (commit)
      from  cbf9d94b1fbec4a56302bb1a38c3b02ff147c434 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 24e75f75b94ce51ce88fad7a4b9fadae12ae3ef3
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jun 10 21:56:31 2026 +0000

    Handle 32-bit platform in fromFlatGeobuf

diff --git a/postgis/flatgeobuf.c b/postgis/flatgeobuf.c
index c984557dd..dc4621eba 100644
--- a/postgis/flatgeobuf.c
+++ b/postgis/flatgeobuf.c
@@ -360,7 +360,7 @@ static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values,
 			if (offset + sizeof(uint32_t) > size)
 				elog(ERROR, "flatgeobuf: decode_properties: Invalid size for uint value");
 			memcpy(&value, data + offset, sizeof(uint32_t));
-			values[ci] = UInt32GetDatum(value);
+			values[ci] = Int64GetDatum((int64_t)(uint64_t) value);
 			offset += sizeof(uint32_t);
 			break;
 		}
@@ -387,10 +387,7 @@ static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values,
 			if (offset + sizeof(float) > size)
 				elog(ERROR, "flatgeobuf: decode_properties: Invalid size for float value");
 			memcpy(&value, data + offset, sizeof(float));
-			if (getBaseType(TupleDescAttr(ctx->tupdesc, ci)->atttypid) == FLOAT8OID)
-				values[ci] = Float8GetDatum((double) value);
-			else
-				values[ci] = Float4GetDatum(value);
+			values[ci] = Float4GetDatum(value);
 			offset += sizeof(float);
 			break;
 		}
diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c
index 8fc2e6efb..235fbbeed 100644
--- a/postgis/lwgeom_in_flatgeobuf.c
+++ b/postgis/lwgeom_in_flatgeobuf.c
@@ -88,24 +88,19 @@ flatgeobuf_type_compatible(uint8_t fgb_type, Oid pgtype)
 	{
 	case flatgeobuf_column_type_bool:
 		return pgtype == BOOLOID;
-	/* small integer types: allow widening into larger signed ints */
 	case flatgeobuf_column_type_byte:
 	case flatgeobuf_column_type_ubyte:
 	case flatgeobuf_column_type_short:
 	case flatgeobuf_column_type_ushort:
-		return pgtype == INT2OID || pgtype == INT4OID || pgtype == INT8OID;
-	/* int32: allow widening to bigint */
+		return pgtype == INT2OID;
 	case flatgeobuf_column_type_int:
-		return pgtype == INT4OID || pgtype == INT8OID;
-	/* uint32 max exceeds INT4, must land in bigint */
+		return pgtype == INT4OID;
 	case flatgeobuf_column_type_uint:
-		return pgtype == INT8OID;
 	case flatgeobuf_column_type_long:
 	case flatgeobuf_column_type_ulong:
 		return pgtype == INT8OID;
-	/* float: allow widening to double (explicit conversion handled in decode) */
 	case flatgeobuf_column_type_float:
-		return pgtype == FLOAT4OID || pgtype == FLOAT8OID;
+		return pgtype == FLOAT4OID;
 	case flatgeobuf_column_type_double:
 		return pgtype == FLOAT8OID;
 	case flatgeobuf_column_type_string:
diff --git a/regress/core/flatgeobuf.sql b/regress/core/flatgeobuf.sql
index 7fb731aa1..f5390a258 100644
--- a/regress/core/flatgeobuf.sql
+++ b/regress/core/flatgeobuf.sql
@@ -176,20 +176,6 @@ select 'MM1' from ST_FromFlatGeobuf(null::flatgeobuf_mm_text, (
 select 'MM2' from ST_FromFlatGeobuf(null::flatgeobuf_mm_long, (
     select ST_AsFlatGeobuf(q) fgb from (select null::geometry, 42::bigint as val1, 43::bigint as val2) q));
 
-select '--- Numeric widening ---';
-
--- integer (int32 in file) widened to bigint in target
-select ST_FromFlatGeobufToTable('public', 'flatgeobuf_widen_i', (select ST_AsFlatGeobuf(q) fgb from (select
-    null::geometry, null::bigint as val) q));
-select 'W1', id, val from ST_FromFlatGeobuf(null::flatgeobuf_widen_i, (
-    select ST_AsFlatGeobuf(q) fgb from (select null::geometry, 42::integer as val) q));
-
--- real (float4 in file) widened to double precision in target
-select ST_FromFlatGeobufToTable('public', 'flatgeobuf_widen_f', (select ST_AsFlatGeobuf(q) fgb from (select
-    null::geometry, null::double precision as val) q));
-select 'W2', id, val from ST_FromFlatGeobuf(null::flatgeobuf_widen_f, (
-    select ST_AsFlatGeobuf(q) fgb from (select null::geometry, 1.5::real as val) q));
-
 select '--- Quoted identifiers ---';
 
 -- Verify that special characters in column names are properly quoted
@@ -216,5 +202,3 @@ drop table if exists public.flatgeobuf_qi;
 drop table if exists public.flatgeobuf_mm_long;
 drop table if exists public.flatgeobuf_mm_text;
 drop table if exists public.flatgeobuf_mm_twocols;
-drop table if exists public.flatgeobuf_widen_i;
-drop table if exists public.flatgeobuf_widen_f;
diff --git a/regress/core/flatgeobuf_expected b/regress/core/flatgeobuf_expected
index ea7e022cc..6e97ee425 100644
--- a/regress/core/flatgeobuf_expected
+++ b/regress/core/flatgeobuf_expected
@@ -27,9 +27,6 @@ E1|0|t|POINT(1.1 2.1)|f
 --- Type mismatch detection ---
 ERROR:  flatgeobuf: column "val" type mismatch: file type "Long" is not compatible with PostgreSQL type text
 ERROR:  flatgeobuf: column count mismatch: file has 2 columns, target type has 1
---- Numeric widening ---
-W1|0|42
-W2|0|1.5
 --- Quoted identifiers ---
 QI1
 QI2

-----------------------------------------------------------------------

Summary of changes:
 postgis/flatgeobuf.c             |  7 ++-----
 postgis/lwgeom_in_flatgeobuf.c   | 11 +++--------
 regress/core/flatgeobuf.sql      | 16 ----------------
 regress/core/flatgeobuf_expected |  3 ---
 4 files changed, 5 insertions(+), 32 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list