From e22d318f889be8df393b169389d220ec103b3916 Mon Sep 17 00:00:00 2001 From: Abdul Sami Waseem Date: Thu, 16 Jul 2026 18:54:22 +0500 Subject: [PATCH] docs: document PostGIS extensions option for point fields Co-authored-by: Cursor --- docs/database/postgres.mdx | 20 ++++++++++++++++++++ docs/fields/point.mdx | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/database/postgres.mdx b/docs/database/postgres.mdx index 545f7a51919..f20839ce89f 100644 --- a/docs/database/postgres.mdx +++ b/docs/database/postgres.mdx @@ -83,6 +83,26 @@ export default buildConfig({ | `readReplicas` | An array of DB read replicas connection strings, can be used to offload read-heavy traffic. | | `readReplicasAfterWriteInterval` | How long (ms) after a write to keep routing reads to the primary instead of a replica. Prevents stale reads caused by replication lag. Only relevant when `readReplicas` is set. Default `2000`. Set to `0` to disable. | | `blocksAsJSON` | Store blocks as a JSON column instead of using the relational structure which can improve performance with a large amount of blocks | +| `extensions` | An array of Postgres extension names to enable (for example `['postgis']`). Payload will create these extensions if they do not already exist. | + +## PostGIS + +To use the [Point field](../fields/point) with Postgres, enable the [PostGIS](https://postgis.net/) extension via the `extensions` option on your database adapter. Your Postgres instance must have PostGIS available (installed on the server or included in your database image). + +```ts +import { postgresAdapter } from '@payloadcms/db-postgres' + +export default buildConfig({ + db: postgresAdapter({ + pool: { + connectionString: process.env.DATABASE_URL, + }, + extensions: ['postgis'], + }), +}) +``` + +The same `extensions` option is available on `@payloadcms/db-vercel-postgres`. ## Access to Drizzle diff --git a/docs/fields/point.mdx b/docs/fields/point.mdx index dd5d1746964..f8394c60d79 100644 --- a/docs/fields/point.mdx +++ b/docs/fields/point.mdx @@ -27,7 +27,10 @@ export const MyPointField: Field = { ``` - **Important:** The Point Field currently is not supported in SQLite. + **Important:** The Point Field currently is not supported in SQLite. When + using Postgres, enable the PostGIS extension via the database adapter's + [`extensions`](../database/postgres#postgis) option (for example `extensions: + ['postgis']`). ## Config