Skip to content

Commit

Permalink
Merge branch 'main' into docs-changelog-2025-01-31
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrenon committed Jan 31, 2025
2 parents eaac137 + fb731af commit 54e5222
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 96 deletions.
4 changes: 2 additions & 2 deletions content/docs/extensions/extensions-intro.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Postgres extensions
enableTableOfContents: true
updatedOn: '2025-01-24T20:21:15.304Z'
updatedOn: '2025-01-30T21:03:38.097Z'
---

Explore supported Postgres extensions by category. Also see:

- [List view of supported extensions and versions](/docs/extensions/pg-extensions)
- [List view](/docs/extensions/pg-extensions)
- [Install an extension](/docs/extensions/pg-extensions#install-an-extension)
- [Update an extension](/docs/extensions/pg-extensions#update-an-extension-version)

Expand Down
164 changes: 82 additions & 82 deletions content/docs/extensions/pg-extensions.md

Large diffs are not rendered by default.

27 changes: 24 additions & 3 deletions content/docs/extensions/pg_cron.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: The pg_cron extension
subtitle: Schedule and manage cron jobs directly within your Neon Postgres database
tag: new
enableTableOfContents: true
updatedOn: '2024-11-01T10:00:00.000Z'
updatedOn: '2025-01-30T21:03:38.101Z'
---

The `pg_cron` extension provides a simple, cron-based job scheduler for Postgres. It operates directly within your database, allowing you to schedule standard SQL commands or calls to stored procedures using familiar cron syntax. This eliminates the need for external cron utilities for many database maintenance and automation tasks.
Expand All @@ -18,9 +18,30 @@ Please note that `pg_cron` jobs will only run when your compute is active. We th

## Enable the `pg_cron` extension

`pg_cron` is currently available only on paid Neon plans. To install `pg_cron`, it must first be enabled by Neon Support. [Open a support ticket](https://console.neon.tech/app/projects?modal=support) with your endpoint ID and database name to request it. After it's enabled by Neon Support, you need to [restart your compute](/docs/manage/endpoints#restart-a-compute) to apply the changes.
To install `pg_cron`, you must first enable it by setting the `cron.database_name` parameter to the name of the database where you want to install `pg_cron`. This requires running an API command using either the [Update project API](https://api-docs.neon.tech/reference/updateproject) or the [Update compute endpoint API](https://api-docs.neon.tech/reference/updateprojectendpoint).

The `cron.database_name` parameter is passed to your Postgres instance through the endpoint settings object. The following `Update project` API example shows where to specify your Neon `project_id`, [Neon API key](/docs/manage/api-keys), and database name.

```bash
curl --request PATCH \
--url https://console.neon.tech/api/v2/projects/<your_project_id> \
--header 'accept: application/json' \
--header 'authorization: Bearer $NEON_API_KEY' \
--header 'content-type: application/json' \
--data '
{
"project": {
"default_endpoint_settings": {
"pg_settings": {
"cron.database_name": "your_db_name"
}
}
}
}
'
```

You can then enable the extension by running the following `CREATE EXTENSION` statement in the [Neon SQL Editor](/docs/get-started-with-neon/query-with-neon-sql-editor) or from a client such as [psql](/docs/connect/query-with-psql-editor) that is connected to your Neon database.
After setting `cron.database_name`, you can then install the `pg_cron` extension by running the following `CREATE EXTENSION` statement in the [Neon SQL Editor](/docs/get-started-with-neon/query-with-neon-sql-editor) or from a client such as [psql](/docs/connect/query-with-psql-editor) that is connected to your Neon database.

```sql
CREATE EXTENSION IF NOT EXISTS pg_cron;
Expand Down
18 changes: 15 additions & 3 deletions content/docs/extensions/pgvector.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subtitle: Enable Postgres as a vector store with the pgvector extension
enableTableOfContents: true
redirectFrom:
- /docs/extensions/pg_embedding
updatedOn: '2024-12-11T21:23:33.085Z'
updatedOn: '2025-01-30T21:03:38.101Z'
---

The `pgvector` extension enables you to store vector embeddings and perform vector similarity search in Postgres. It is particularly useful for applications involving natural language processing, such as those built on top of OpenAI's GPT models.
Expand All @@ -23,13 +23,25 @@ This topic describes how to enable the `pgvector` extension in Neon and how to c

## Enable the pgvector extension

You can enable the `pgvector` extension by running the following `CREATE EXTENSION` statement in the **Neon SQL Editor** or from a client such as `psql` that is connected to Neon.
You can enable the `pgvector` extension by running the following `CREATE EXTENSION` statement in the [Neon SQL Editor](<(/docs/get-started-with-neon/query-with-neon-sql-editor)>) or from a client such as [psql](<(/docs/connect/query-with-psql-editor)>) that is connected to Neon.

```sql
CREATE EXTENSION vector;
```

For information about using the Neon SQL Editor, see [Query with Neon's SQL Editor](/docs/get-started-with-neon/query-with-neon-sql-editor). For information about using the `psql` client with Neon, see [Connect with psql](/docs/connect/query-with-psql-editor).
## Use a previous version of pgvector

Neon allows you to install the previous version of `pgvector`, which is one version behind the latest supported version.

For example, if Neon’s latest supported `pgvector` version is 0.8.0, you can install the prior version, 0.7.4, by specifying the version number:

```sql
CREATE EXTENSION vector VERSION '0.7.4';
```

To check the latest supported `pgvector` version on Neon, visit our [Postgres extension page](/docs/extensions/extensions-intro). You can install one version back from that version.

For a full version history, see the [pgvector changelog](https://github.com/pgvector/pgvector/blob/master/CHANGELOG.md). Note that `pgvector` versions are not always sequential — for example, version 0.7.4 was followed by 0.8.0.

## Create a table to store vectors

Expand Down
6 changes: 1 addition & 5 deletions content/docs/extensions/postgres_fdw.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ title: The postgres_fdw extension
subtitle: Access data in remote Postgres databases from Neon using postgres_fdw
tag: new
enableTableOfContents: true
updatedOn: '2025-01-24T19:33:03.064Z'
updatedOn: '2025-01-30T21:03:38.102Z'
---

<Admonition type="important" title="coming soon">
Support for the `postgres_fdw` extension is coming to Neon soon. Please check the [Neon Changelog](https://neon.tech/docs/changelog) for updates.
</Admonition>

The `postgres_fdw` (Foreign Data Wrapper) extension provides a powerful and standards-compliant way to access data stored in external Postgres databases from your Neon project. For compliance or regulatory reasons, you might need to keep sensitive data on-premises or within a specific jurisdiction; `postgres_fdw` lets you query this data directly from your Neon database without migrating it, maintaining data residency. This enables you to leverage Neon's features while adhering to data storage policies. This simplifies data integration, enables cross-database querying, and allows you to build applications that seamlessly interact with data across different Postgres deployments.

This guide will walk you through the essentials of using the `postgres_fdw` extension in Neon. You'll learn how to enable the extension, establish connections to remote Postgres servers, define foreign tables that map to tables on those servers, and execute queries that span across your Neon database and remote instances. We will also cover important considerations for performance and security when working with `postgres_fdw`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PostgreSQL supports the most popular programming languages:
- Python
- Java
- C\#
- C/C\+
- C/C\+\+
- Ruby
- JavaScript (Node.js)
- Perl
Expand Down

0 comments on commit 54e5222

Please sign in to comment.