cockroachdb / cockroachdb/cockroach

GeometryType function's return value casing doesn't match PostGIS

Open
#152,593 1 comment 0 reactions 0 assignees View on GitHub
A-geometry-builtins A-sql-pgcompat C-bug E-quick-win O-community T-sql-queries X-blathers-triaged
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

CockroachDB's `GeometryType` function returns values like `GeometryCollection` rather than uppercased values like `GEOMETRYCOLLECTION`.

**To Reproduce**

Look at this test: https://github.com/cockroachdb/cockroach/blob/f1a5c43304283ad2b479f4002f24c9cec37e12ae/pkg/sql/logictest/testdata/logic_test/geospatial#L3423-L3450

**Expected behavior**

The values in the geometrytype column should be uppercased: GEOMETRYCOLLECTION, LINESTRING, etc. consistent with the documented behavior of PostGIS's [GeometryType](https://postgis.net/docs/GeometryType.html).

**Environment:**
- CockroachDB version 25.3.0

**Additional context**

Django 6.0 [adds support for the `GeometryType` function](https://github.com/django/django/commit/a5b0a618c3ff16f9f52a9abdc89c05899ef112b4) and the test doesn't pass because of the behavior difference.

Jira issue: CRDB-53936

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.