#16729·payload

(Postgres) Point field breaks version updates (v3)

Author: kunKun-txCreated May 23, 2026Updated Sep 11, 2026
Labelsdb: postgresstalev3

Describe the Bug

When using @payloadcms/db-postgres with a collection that has both a point field and versions enabled, updating a document fails while Payload tries to insert the version row into _v table

The main collection update appears to receive the point value as valid GeoJSON:

javascript
{
  type: 'Point',
  coordinates: [11, 1],
}

But when Payload saves the version row into the collection’s _v table, the point value is passed as the normalized Payload point array:

javascript
[11, 1]

The insert action was done by calling ST_GeomFromGeoJSON() which expects a valid GeoJSON but gets an array here and would fail with unknown GeoJSON type.

The whole update & creation operation seems to be wrapped in a transaction, thus keeping everything untouched.

Link to the code that reproduces this issue

https://github.com/kunKun-tx/payload-point-ver-test

Reproduction Steps

Steps to recreate issue

  1. Create a Payload v3 project using @payloadcms/db-postgres.
  2. Use PostgreSQL with PostGIS enabled.
  3. Update an existing collection with a new point field
    javascript
    {
      name: 'coordinates',
      type: 'point',
      required: true,
      index: true,
    }
  4. Enable versioning
    javascript
    versions: {
      maxPerDoc: 30,
      drafts: true,
    }
  5. Create a new collection item and save
  6. Update the recently created item, any field will do.
  7. The main update starts, but saving the version row fails with unknown GeoJSON type

Expected Behavior

The original item shall be updated and a new record in the _v table shall be created.

Actual Behavior

The admin UI displays a red error message, Something went wrong. Payload fails while inserting into the version table because ST_GeomFromGeoJSON receives [lng, lat] instead of a GeoJSON object.

Typical error message

ERROR: Failed query

Query:

insert into "_media_v" (
  "id",
  "parent_id",
  "version_alt",
  "version_point",
  "version_updated_at",
  "version_created_at",
  "version__status",
  "version_url",
  "version_thumbnail_u_r_l",
  "version_filename",
  "version_mime_type",
  "version_filesize",
  "version_width",
  "version_height",
  "version_focal_x",
  "version_focal_y",
  "created_at",
  "updated_at",
  "latest"
)
values (
  default,
  $1,
  $2,
  ST_GeomFromGeoJSON($3),
  $4,
  $5,
  $6,
  $7,
  $8,
  $9,
  $10,
  $11,
  $12,
  $13,
  $14,
  $15,
  $16,
  $17,
  $18
)
returning
  "id",
  "parent_id",
  "version_alt",
  "version_point",
  "version_updated_at",
  "version_created_at",
  "version__status",
  "version_url",
  "version_thumbnail_u_r_l",
  "version_filename",
  "version_mime_type",
  "version_filesize",
  "version_width",
  "version_height",
  "version_focal_x",
  "version_focal_y",
  "created_at",
  "updated_at",
  "latest";

Params:

$1   <document_id>
$2   <redacted>
$3   [12,22]
$4   <timestamp>
$5   <timestamp>
$6   published
$7   <redacted_media_url>
$8   null
$9   <redacted_filename>
$10  image/png
$11  15225
$12  186
$13  186
$14  50
$15  50
$16  <timestamp>
$17  <timestamp>
$18  true

Error:

DrizzleQueryError: unknown GeoJSON type

Stack:

Error: Failed query: insert into "_media_v" (
  "id",
  "parent_id",
  "version_alt",
  "version_point",
  "version_updated_at",
  "version_created_at",
  "version__status",
  "version_url",
  "version_thumbnail_u_r_l",
  "version_filename",
  "version_mime_type",
  "version_filesize",
  "version_width",
  "version_height",
  "version_focal_x",
  "version_focal_y",
  "created_at",
  "updated_at",
  "latest"
)
values (
  default,
  $1,
  $2,
  ST_GeomFromGeoJSON($3),
  $4,
  $5,
  $6,
  $7,
  $8,
  $9,
  $10,
  $11,
  $12,
  $13,
  $14,
  $15,
  $16,
  $17,
  $18
)
returning
  "id",
  "parent_id",
  "version_alt",
  "version_point",
  "version_updated_at",
  "version_created_at",
  "version__status",
  "version_url",
  "version_thumbnail_u_r_l",
  "version_filename",
  "version_mime_type",
  "version_filesize",
  "version_width",
  "version_height",
  "version_focal_x",
  "version_focal_y",
  "created_at",
  "updated_at",
  "latest";

params:
  <document_id>,
  <redacted>,
  [12,22],
  <timestamp>,
  <timestamp>,
  published,
  <redacted_media_url>,
  null,
  <redacted_filename>,
  image/png,
  15225,
  186,
  186,
  50,
  50,
  <timestamp>,
  <timestamp>,
  true

Which area(s) are affected?

db: postgres

Environment Info

Binaries:
  Node: 23.11.0
  npm: 11.1.0
  Yarn: 1.22.17
  pnpm: 10.28.1
Relevant Packages:
  payload: 3.84.1
  next: 16.2.6
  @payloadcms/db-postgres: 3.84.1
  @payloadcms/drizzle: 3.84.1
  @payloadcms/graphql: 3.84.1
  @payloadcms/next/utilities: 3.84.1
  @payloadcms/richtext-lexical: 3.84.1
  @payloadcms/translations: 3.84.1
  @payloadcms/ui/shared: 3.84.1
  react: 19.2.6
  react-dom: 19.2.6
Operating System:
  Platform: linux
  Arch: x64
  Version: #111~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 14 17:13:45 UTC 
  Available memory (MB): 17079
  Available CPU cores: 8