Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/database/postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion docs/fields/point.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const MyPointField: Field = {
```

<Banner type="warning">
**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']`).
</Banner>

## Config
Expand Down
Loading