diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index 9e3fc221b2..d687ae296d 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -2,6 +2,8 @@
This is the PostgreSQL provider for [Entity Framework Core](https://github.com/dotnet/efcore), built on top of [Npgsql](https://github.com/npgsql/npgsql). It translates EF Core LINQ queries into PostgreSQL SQL and handles PostgreSQL-specific features like arrays, JSON, ranges, full-text search, NodaTime, and PostGIS/NetTopologySuite.
+Conceptual documentation lives in `docs/`. Update it as appropriate alongside code changes.
+
## Build and Test
Use the SDK pinned in `global.json` and dependency versions centralized in `Directory.Packages.props`. Consult EF APIs and test bases matching the pinned version; do not upgrade dependencies just to make a change compile.
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000000..ab929e76bd
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,47 @@
+name: Documentation
+
+on:
+ push:
+ branches: [main]
+ paths: ['docs/**']
+ pull_request:
+ paths: ['docs/**']
+
+permissions:
+ contents: read
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v7.0.0
+ with:
+ node-version: 24.x
+
+ - name: Run Markdownlint
+ run: |
+ npm i -g markdownlint-cli
+ markdownlint --config docs/.markdownlint.json "docs/**/*.md"
+
+ dispatch:
+ needs: lint
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'npgsql/efcore.pg'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Create GitHub App token
+ id: app-token
+ uses: actions/create-github-app-token@v2
+ with:
+ app-id: ${{ secrets.DOCS_APP_ID }}
+ private-key: ${{ secrets.DOCS_APP_PRIVATE_KEY }}
+ owner: npgsql
+ repositories: doc
+
+ - name: Trigger documentation build
+ env:
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
+ run: gh api --method POST repos/npgsql/doc/dispatches -f event_type=docs-changed
diff --git a/.github/workflows/trigger-doc-build.yml b/.github/workflows/trigger-doc-build.yml
deleted file mode 100644
index e8783c9e16..0000000000
--- a/.github/workflows/trigger-doc-build.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-# This workflow triggers a rebuild of the Npgsql documentation site whenever changes are made to master, which represents our latest released version.
-# This pulls in the newest source code for API doc generation.
-
-name: Trigger Documentation Build
-
-on:
- push:
- branches:
- - docs
-
-permissions:
- contents: read
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - name: Trigger documentation build
- run: |
- curl -X POST \
- -H "Authorization: token ${{ secrets.DOC_MGMT_TOKEN }}" \
- -H "Accept: application/vnd.github.everest-preview+json" \
- -H "Content-Type: application/json" \
- --data '{ "event_type": "Npgsql push to stable" }' \
- https://api.github.com/repos/npgsql/doc/dispatches
diff --git a/docs/.markdownlint.json b/docs/.markdownlint.json
new file mode 100644
index 0000000000..5d758ba0f3
--- /dev/null
+++ b/docs/.markdownlint.json
@@ -0,0 +1,16 @@
+{
+ "default": true,
+ "MD011": false,
+ "MD013": false,
+ "MD024": false,
+ "MD028": false,
+ "MD033": { "allowed_elements": ["del", "a", "sup"] },
+ "MD051": false,
+ "MD046": {
+ "style": "fenced"
+ },
+ "MD055": false,
+ "MD056": false,
+ "MD059": false,
+ "MD060": false
+}
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000000..7d1b6c633e
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,168 @@
+# Npgsql Entity Framework Core Provider
+
+[](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL/)
+[](https://www.myget.org/feed/npgsql/package/nuget/Npgsql.EntityFrameworkCore.PostgreSQL)
+[](https://www.myget.org/feed/npgsql-vnext/package/nuget/Npgsql.EntityFrameworkCore.PostgreSQL)
+[](https://github.com/npgsql/efcore.pg/actions)
+
+Npgsql has an Entity Framework (EF) Core provider. It behaves like other EF Core providers (e.g. SQL Server), so the [general EF Core docs](https://docs.microsoft.com/ef/core/index) apply here as well. If you're just getting started with EF Core, those docs are the best place to start.
+
+Development happens in the [Npgsql.EntityFrameworkCore.PostgreSQL](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL) repository, all issues should be reported there.
+
+## Configuring the project file
+
+To use the Npgsql EF Core provider, add a dependency on `Npgsql.EntityFrameworkCore.PostgreSQL`. You can follow the instructions in the general [EF Core Getting Started docs](https://docs.microsoft.com/ef/core/get-started/).
+
+Below is a `.csproj` file for a console application that uses the Npgsql EF Core provider:
+
+```xml
+
+
+ net8.0
+
+
+
+
+
+```
+
+## Defining a model and a `DbContext`
+
+Let's say you want to store blogs and their posts in their database; you can model these as .NET types as follows:
+
+```csharp
+public class Blog
+{
+ public int BlogId { get; set; }
+ public string Url { get; set; }
+
+ public List Posts { get; set; }
+}
+
+public class Post
+{
+ public int PostId { get; set; }
+ public string Title { get; set; }
+ public string Content { get; set; }
+
+ public int BlogId { get; set; }
+ public Blog Blog { get; set; }
+}
+```
+
+You then define a `DbContext` type which you'll use to interact with the database:
+
+### [OnConfiguring](#tab/onconfiguring)
+
+Using `OnConfiguring()` to configure your context is the easiest way to get started, but is discouraged for most production applications:
+
+```csharp
+public class BloggingContext : DbContext
+{
+ public DbSet Blogs { get; set; }
+ public DbSet Posts { get; set; }
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql("");
+}
+
+// At the point where you need to perform a database operation:
+using var context = new BloggingContext();
+// Use the context...
+```
+
+### [DbContext pooling](#tab/context-pooling)
+
+```csharp
+var dbContextFactory = new PooledDbContextFactory(
+ new DbContextOptionsBuilder()
+ .UseNpgsql("")
+ .Options);
+
+// At the point where you need to perform a database operation:
+using var context = dbContextFactory.CreateDbContext();
+// Use the context...
+```
+
+### [ASP.NET / DI](#tab/aspnet)
+
+When using ASP.NET - or any application with dependency injection - the context instance will be injected into your code. Use the following to configure EF with your DI container:
+
+```csharp
+var builder = WebApplication.CreateBuilder(args);
+
+builder.Services.AddDbContextPool(opt =>
+ opt.UseNpgsql(builder.Configuration.GetConnectionString("BloggingContext")));
+
+public class BloggingContext(DbContextOptions options) : DbContext(options)
+{
+ public DbSet Blogs { get; set; }
+ public DbSet Posts { get; set; }
+}
+```
+
+***
+
+For more information on getting started with EF, consult the [EF getting started documentation](https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli).
+
+## Additional Npgsql configuration
+
+The Npgsql EF provider is built on top of the lower-level Npgsql ADO.NET provider ([docs](https://www.npgsql.org/doc/index.html)); these two separate components support various options you may want to configure.
+
+If you're using EF 9.0 or above, the `UseNpgsql()` is a single point where you can configure everything related to Npgsql. For example:
+
+```csharp
+builder.Services.AddDbContextPool(opt =>
+ opt.UseNpgsql(
+ builder.Configuration.GetConnectionString("BloggingContext"),
+ o => o
+ .SetPostgresVersion(13, 0)
+ .UseNodaTime()
+ .MapEnum("mood")));
+```
+
+The above configures the EF provider to produce SQL for PostgreSQL version 13 (avoiding newer incompatible features), adds a plugin allowing use of NodaTime for date/time type mapping, and maps a .NET enum type. Note that the last two also require configuration at the lower-level ADO.NET layer, which the code above does for you automatically.
+
+If you need to configure something at the lower-level ADO.NET layer, use `ConfigureDataSource()` as follows:
+
+```csharp
+builder.Services.AddDbContextPool(opt =>
+ opt.UseNpgsql(
+ builder.Configuration.GetConnectionString("BloggingContext"),
+ o => o.ConfigureDataSource(dataSourceBuilder => dataSourceBuilder.UseClientCertificate(certificate))));
+```
+
+`ConfigureDataSource()` provides access to a lower-level [`NpgsqlDataSourceBuilder`](/doc/basic-usage.html#data-source) which you can use to configure all aspects of the Npgsql ADO.NET provider.
+
+> [!WARNING]
+> The EF provider internally creates an NpgsqlDataSource and uses that; for most configuration (e.g. connection string), the provider knows to switch between NpgsqlDataSources automatically.
+> However, it's not possible to detect configuration differences within the `ConfigureDataSource()`; as a result, avoid performing varying configuration inside `ConfigureDataSource()`, since you may
+> get the wrong NpgsqlDataSource. If you find yourself needing to vary Npgsql ADO.NET configuration, create an external NpgsqlDataSource yourself with the desired configuration and pass that to
+> `UseNpgsql()` as described below.
+
+### Using an external NpgsqlDataSource
+
+If you're using a version of EF prior to 9.0, the above configuration methods aren't available. You can still create an NpgsqlDataSource yourself, and then pass it to EF's `UseNpgsql()`:
+
+```csharp
+var dataSourceBuilder = new NpgsqlDataSourceBuilder(builder.Configuration.GetConnectionString("BloggingContext"));
+dataSourceBuilder.MapEnum();
+dataSourceBuilder.UseNodaTime();
+var dataSource = dataSourceBuilder.Build();
+
+builder.Services.AddDbContextPool(opt => opt
+ .UseNpgsql(dataSource, o => o
+ .SetPostgresVersion(13, 0)
+ .UseNodaTime()
+ .MapEnum("mood")));
+```
+
+Note that when using an external NpgsqlDataSource, you need to configure mappings and plugins at both levels yourself - both on the NpgsqlDataSource and at the EF provider level.
+
+## Using an Existing Database (Database-First)
+
+The Npgsql EF Core provider also supports reverse-engineering a code model from an existing PostgreSQL database ("database-first"). To do so, use dotnet CLI to execute the following:
+
+```bash
+dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL
+```
diff --git a/docs/mapping/array.md b/docs/mapping/array.md
new file mode 100644
index 0000000000..15b72215f0
--- /dev/null
+++ b/docs/mapping/array.md
@@ -0,0 +1,54 @@
+# Array Type Mapping
+
+PostgreSQL has the unique feature of supporting [*array data types*](https://www.postgresql.org/docs/current/static/arrays.html). This allow you to conveniently and efficiently store several values in a single column, where in other database you'd typically resort to concatenating the values in a string or defining another table with a one-to-many relationship.
+
+> [!NOTE]
+> Although PostgreSQL supports multidimensional arrays, these aren't yet supported by the EF Core provider.
+
+## Mapping arrays
+
+Simply define a regular .NET array or `List<>` property:
+
+```csharp
+public class Post
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public string[] Tags { get; set; }
+ public List AlternativeTags { get; set; }
+}
+```
+
+The provider will create `text[]` columns for the above two properties, and will properly detect changes in them - if you load an array and change one of its elements, calling `SaveChanges` will automatically update the row in the database accordingly.
+
+## Operation translation
+
+The provider can also translate CLR array operations to the corresponding SQL operation; this allows you to efficiently work with arrays by evaluating operations in the database and avoids pulling all the data. The following table lists the range operations that currently get translated; all these translations work both for .NET arrays (`int[]`) and for generic Lists (`List`). If you run into a missing operation, please open an issue.
+
+.NET | SQL | Notes
+--------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----
+array[0] | [array\[1\]](https://www.postgresql.org/docs/current/arrays.html#ARRAYS-ACCESSING) |
+array.Length / list.Count | [cardinality(array)](https://www.postgresql.org/docs/current/static/functions-array.html#ARRAY-FUNCTIONS-TABLE) |
+array.Skip(2) | [array\[3,\]](https://www.postgresql.org/docs/current/arrays.html#ARRAYS-ACCESSING) | Added in 8.0
+array.Take(2) | [array\[,2\]](https://www.postgresql.org/docs/current/arrays.html#ARRAYS-ACCESSING) | Added in 8.0
+array.Skip(1).Take(2) | [array\[2,3\]](https://www.postgresql.org/docs/current/arrays.html#ARRAYS-ACCESSING) | Added in 8.0
+array1 == array2 | [array1 = array2](https://www.postgresql.org/docs/current/static/arrays.html) |
+array1.SequenceEqual(array2) | [array1 = array2](https://www.postgresql.org/docs/current/static/arrays.html) |
+array1.Take(2).SequenceEqual(array2) | [array1\[:2\] = array2](https://www.postgresql.org/docs/current/arrays.html#ARRAYS-ACCESSING) | Added in 11.0; also supports Skip() and Skip().Take()
+arrayNonColumn.Contains(element) | [element = ANY(arrayNonColumn)](https://www.postgresql.org/docs/current/static/functions-comparisons.html#AEN21104) | Can use regular index
+arrayColumn.Contains(element) | [arrayColumn @> ARRAY\[element\]](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-OPERATORS-TABLE) | Can use GIN index
+array.Append(element) | [array_append(array, element)](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) | Added in 6.0
+array.Where(i => i != 8) | [array_remove(array, value)](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) | Added in 9.0
+array1.Concat(array2) | [array1 \|\| array2](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) | Added in 6.0
+array.IndexOf(element) | [array_position(array, element) - 1](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) | Added in 6.0
+array.IndexOf(element, startIndex) | [array_position(array, element, startIndex + 1) - 1](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) | Added in 6.0
+String.Join(separator, array) | [array_to_string(array, separator, '')](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) | Added in 6.0
+array.Any() | [cardinality(array) > 0](https://www.postgresql.org/docs/current/static/functions-array.html#ARRAY-FUNCTIONS-TABLE) |
+array1.Intersect(array2).Any() | [array1 && array2](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-OPERATORS-TABLE) | Added in 8.0
+array1.Any(i => array2.Contains(i)) | [array1 && array2](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-OPERATORS-TABLE) |
+array1.All(i => array2.Contains(i)) | [array1 <@ array2](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-OPERATORS-TABLE) |
+array.Any(s => EF.Functions.Like(string, s)) | [string LIKE ANY (array)](https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.30.16) |
+array.Any(s => EF.Functions.ILike(string, s)) | [string ILIKE ANY (array)](https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.30.16) |
+array.All(s => EF.Functions.Like(string, s)) | [string LIKE ALL (array)](https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.30.16) |
+array.All(s => EF.Functions.ILike(string, s)) | [string ILIKE ALL (array)](https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.30.16) |
+EF.Functions.ArrayAgg(values) | [array_agg(values)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | Added in 7.0, See [Aggregate functions](translations.md#aggregate-functions).
diff --git a/docs/mapping/enum.md b/docs/mapping/enum.md
new file mode 100644
index 0000000000..301e77dfb9
--- /dev/null
+++ b/docs/mapping/enum.md
@@ -0,0 +1,126 @@
+# Enum Type Mapping
+
+By default, any enum properties in your model will be mapped to database integers. EF Core 2.1 also allows you to map these to strings in the database with value converters.
+
+However, the Npgsql provider also allows you to map your CLR enums to [database enum types](https://www.postgresql.org/docs/current/static/datatype-enum.html). This option, unique to PostgreSQL, provides the best of both worlds: the enum is internally stored in the database as a number (minimal storage), but is handled like a string (more usable, no need to remember numeric values) and has type safety.
+
+## Setting up your enum with EF
+
+> [!NOTE]
+> Enum mapping has changed considerably in EF 9.0.
+
+If you're using EF 9.0 or above, simply call `MapEnum` inside your `UseNpgsql` invocation.
+
+### [With a connection string](#tab/with-connection-string)
+
+If you're passing a connection string to `UseNpgsql`, simply add the `MapEnum` call as follows:
+
+```csharp
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ "",
+ o => o.MapEnum("mood")));
+```
+
+This configures all aspects of Npgsql to use your `Mood` enum - both at the EF and the lower-level Npgsql layer - and ensures that the enum is created in the database in EF migrations.
+
+### [With an external NpgsqlDataSource](#tab/with-external-datasource)
+
+If you're creating an external NpgsqlDataSource and passing it to `UseNpgsql`, you must make sure to map your enum on that data independently of the EF-level setup:
+
+```csharp
+var dataSourceBuilder = new NpgsqlDataSourceBuilder("");
+dataSourceBuilder.MapEnum();
+var dataSource = dataSourceBuilder.Build();
+
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ dataSource,
+ o => o.MapEnum("mood")));
+```
+
+***
+
+### Older EF versions
+
+On versions of EF prior to 9.0, enum setup is more involved and consists of several steps; enum mapping has to be done at the lower-level Npgsql layer, and also requires explicit configuration in the EF model for creation in the database via migrations.
+
+#### Creating your database enum
+
+First, you must specify the PostgreSQL enum type on your model, just like you would with tables, sequences or other databases objects:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder builder)
+ => builder.HasPostgresEnum();
+```
+
+This causes the EF Core provider to create your enum type, `mood`, with two labels: `happy` and `sad`. This will cause the appropriate migration to be created.
+
+#### Mapping your enum
+
+Even if your database enum is created, Npgsql has to know about it, and especially about your CLR enum type that should be mapped to it:
+
+##### [NpgsqlDataSource](#tab/with-datasource)
+
+Since version 7.0, NpgsqlDataSource is the recommended way to use Npgsql. When using NpgsqlDataSource, map your enum when building your data source:
+
+```csharp
+// Call MapEnum() when building your data source:
+var dataSourceBuilder = new NpgsqlDataSourceBuilder(/* connection string */);
+dataSourceBuilder.MapEnum();
+var dataSource = dataSourceBuilder.Build();
+
+builder.Services.AddDbContext(options => options.UseNpgsql(dataSource));
+```
+
+##### [Without NpgsqlDatasource](#tab/without-datasource)
+
+Since version 7.0, NpgsqlDataSource is the recommended way to use Npgsql. However, if you're not yet using NpgsqlDataSource, map enums by adding the following code, *before* any EF Core operations take place. An appropriate place for this is in the static constructor on your DbContext class:
+
+```csharp
+static MyDbContext()
+ => NpgsqlConnection.GlobalTypeMapper.MapEnum();
+```
+
+> [!NOTE]
+> If you have multiple context types, all `MapEnum` invocations must be done before *any* of them is used; this means that the code cannot be in your static constructors, but must be moved to the program start.
+
+***
+
+This code lets Npgsql know that your CLR enum type, `Mood`, should be mapped to a database enum called `mood`. Note that if your enum is in a custom schema (not `public`), you must specify that schema in the call to `MapEnum`.
+
+## Using enum properties
+
+Once your enum is properly set up with EF, you can use your CLR enum type just like any other property:
+
+```csharp
+public class Blog
+{
+ public int Id { get; set; }
+ public Mood Mood { get; set; }
+}
+
+using (var ctx = new MyDbContext())
+{
+ // Insert
+ ctx.Blogs.Add(new Blog { Mood = Mood.Happy });
+ ctx.Blogs.SaveChanges();
+
+ // Query
+ var blog = ctx.Blogs.Single(b => b.Mood == Mood.Happy);
+}
+```
+
+## Altering enum definitions
+
+The Npgsql provider only allow adding new values to existing enums, and the appropriate migrations will be automatically created as you add values to your CLR enum type. However, PostgreSQL itself doesn't support removing enum values (since these may be in use), and while renaming values is supported, it isn't automatically done by the provider to avoid using unreliable detection heuristics. Renaming an enum value can be done by including [raw SQL](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/managing?tabs=dotnet-core-cli#arbitrary-changes-via-raw-sql) in your migrations as follows:
+
+```csharp
+migrationBuilder.Sql("ALTER TYPE mood RENAME VALUE 'happy' TO 'thrilled';");
+```
+
+As always, test your migrations carefully before running them on production databases.
+
+## Scaffolding from an existing database
+
+If you're creating your model from an existing database, the provider will recognize enums in your database, and scaffold the appropriate `HasPostgresEnum()` lines in your model. However, the scaffolding process has no knowledge of your CLR type, and will therefore skip your enum columns (warnings will be logged). You will have to create the CLR type and perform the proper setup as described above.
+
+In the future it may be possible to scaffold the actual enum type (and with it the properties), but this isn't supported at the moment.
diff --git a/docs/mapping/full-text-search.md b/docs/mapping/full-text-search.md
new file mode 100644
index 0000000000..890573fc6e
--- /dev/null
+++ b/docs/mapping/full-text-search.md
@@ -0,0 +1,133 @@
+# Full Text Search
+
+PostgreSQL has [built-in support for full-text search](https://www.postgresql.org/docs/current/static/textsearch.html), which allows you to conveniently and efficiently query natural language documents.
+
+## Mapping
+
+PostgreSQL full text search types are mapped onto .NET types built-in to Npgsql. The `tsvector` type is mapped to `NpgsqlTsVector` and `tsquery` is mapped to `NpgsqlTsQuery`. This means you can use properties of type `NpgsqlTsVector` directly in your model to create `tsvector` columns. The `NpgsqlTsQuery` type on the other hand, is used in LINQ queries.
+
+```csharp
+public class Product
+{
+ public int Id { get; set; }
+ public string Title { get; set; }
+ public string Description { get; set; }
+ public NpgsqlTsVector SearchVector { get; set; }
+}
+```
+
+## Setting up and querying a full text search index on an entity
+
+[As the PostgreSQL documentation explains](https://www.postgresql.org/docs/current/static/textsearch-tables.html), full-text search requires an index to run efficiently. This section will show two ways to do this, each having its benefits and drawbacks. Please read the PostgreSQL docs for more information on the two different approaches.
+
+### Method 1: tsvector column
+
+This method adds a `tsvector` column to your table, that is automatically updated when the row is modified. First, add an `NpgsqlTsVector` property to your entity:
+
+```csharp
+public class Product
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public string Description { get; set; }
+ public NpgsqlTsVector SearchVector { get; set; }
+}
+```
+
+Then, configure the property to be a [stored generated column](../modeling/generated-properties.md#computed-generated-columns): the provider has an API for setting that up:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity()
+ .HasGeneratedTsVectorColumn(
+ p => p.SearchVector,
+ "english", // Text search config
+ p => new { p.Name, p.Description }) // Included properties
+ .HasIndex(p => p.SearchVector)
+ .HasMethod("GIN"); // Index method on the search vector (GIN or GIST)
+}
+```
+
+Note that `HasGeneratedTsVectorColumn()` is simply a bit of sugar of EF's standard `HasComputedColumnSql()`; if there's anything you need which isn't covered by `HasGeneratedTsVectorColumn()`, simply use `HasComputedColumnSql()`.
+
+Once your generated `tsvector` column is set up, any inserts or updates on the `Products` table will update the `SearchVector` column and maintain it automatically. You can query it as follows:
+
+```csharp
+var context = new ProductDbContext();
+var npgsql = context.Products
+ .Where(p => p.SearchVector.Matches("Npgsql"))
+ .ToList();
+```
+
+### Method 2: Expression index
+
+If you prefer to have an expression index rather than a generated column, use the following API to do so:
+
+```csharp
+modelBuilder.Entity()
+ .HasIndex(b => new { b.Title, b.Description })
+ .HasMethod("GIN")
+ .IsTsVectorExpressionIndex("english");
+```
+
+Once the index is created on the `Title` and `Description` columns, you can query as follows:
+
+```csharp
+var context = new ProductDbContext();
+var npgsql = context.Products
+ .Where(p => EF.Functions.ToTsVector("english", p.Title + " " + p.Description)
+ .Matches("Npgsql"))
+ .ToList();
+```
+
+## Computed column over JSON columns
+
+The provider can also create computed `tsvector` columns over JSON columns. Simply use `HasGeneratedTsVectorColumn()` as shown above, and when applied to JSON columns, the provider will automatically generate [`json_to_tsvector/jsonb_to_tsvector`](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE) as appropriate.
+
+Note that this will pass the filter `all` to these functions, meaning that all values in the JSON document will be included. To customize the filter - or to create the computed column on older versions of the provider - simply specify the function yourself via [`HasComputedColumnSql`](https://docs.microsoft.com/ef/core/modeling/generated-properties?tabs=data-annotations#computed-generated-columns).
+
+## Operation translation
+
+Almost all PostgreSQL full text search functions can be called through LINQ queries. All supported EF Core LINQ methods are defined in extension classes in the `Microsoft.EntityFrameworkCore` namespace, so simply referencing the Npgsql provider will light up these methods. The following table lists all supported operations; if an operation you need is missing, please open an issue to request for it.
+
+.NET | SQL
+----------------------------------------------------------------------------|-----
+EF.Functions.ToTsVector(string) | [to_tsvector(string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-DOCUMENTS)
+EF.Functions.ToTsVector("english", string) | [to_tsvector('english'::regconfig, string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-DOCUMENTS)
+EF.Functions.ToTsQuery(string) | [to_tsquery(string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.ToTsQuery("english", string ) | [to_tsquery('english'::regconfig, string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.PlainToTsQuery(string) | [plainto_tsquery(string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.PlainToTsQuery("english", string) | [plainto_tsquery('english'::regconfig, string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.PhraseToTsQuery(string) | [phraseto_tsquery(string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.PhraseToTsQuery("english", string) | [phraseto_tsquery('english'::regconfig, string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.WebSearchToTsQuery(string) | [websearch_to_tsquery(string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.WebSearchToTsQuery("english", string) | [websearch_to_tsquery('english'::regconfig, string)](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+EF.Functions.ArrayToTsVector(new[] { "a", "b" }) | [array_to_tsvector(ARRAY\['a', 'b'\])](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+NpgsqlTsVector.Parse(string) | [CAST(string AS tsvector)](https://www.postgresql.org/docs/current/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS)
+NpgsqlTsQuery.Parse(string) | [CAST(queryString AS tsquery)](https://www.postgresql.org/docs/current/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS)
+tsvector.Matches(string) | [tsvector @@ plainto_tsquery(string)](https://www.postgresql.org/docs/current/static/textsearch-intro.html#TEXTSEARCH-MATCHING)
+tsvector.Matches(tsquery) | [tsvector @@ tsquery](https://www.postgresql.org/docs/current/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES)
+tsquery1.And(tsquery2) | [tsquery1 && tsquery2](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery1.Or(tsquery2) | [tsquery1 \|\| tsquery2](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery.ToNegative() | [!! tsquery](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery1.Contains(tsquery2) | [tsquery1 @> tsquery2](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery1.IscontainedIn(tsquery2) | [tsquery1 <@ tsquery2](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery.GetNodeCount() | [numnode(query)](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery.GetQueryTree() | [querytree(query)](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSQUERY)
+tsquery.GetResultHeadline("a b c") | [ts_headline('a b c', query)](https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-HEADLINE)
+tsquery.GetResultHeadline("a b c", "MinWords=1, MaxWords=2") | [ts_headline('a b c', query, 'MinWords=1, MaxWords=2')](https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-HEADLINE)
+tsquery.Rewrite(targetQuery, substituteQuery) | [ts_rewrite(to_tsquery(tsquery), to_tsquery(targetQuery), to_tsquery(substituteQuery))](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsquery1.ToPhrase(tsquery2) | [tsquery_phrase(tsquery1, tsquery2)](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsquery1.ToPhrase(tsquery2, distance) | [tsquery_phrase(tsquery1, tsquery2, distance)](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsvector1.Concat(tsvector2) | [tsvector1 \|\| tsvector2](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-OPERATORS-TABLE)
+tsvector.Delete("x") | [ts_delete(tsvector, 'x')](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsvector.Delete(new[] { "x", "y" }) | [ts_delete(tsvector, ARRAY\['x', 'y'\])](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsvector.Filter(new[] { "x", "y" }) | [ts_filter(tsvector, ARRAY\['x', 'y'\])](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsvector.GetLength() | [length(tsvector)](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+tsvector.Rank(tsquery) | [ts_rank(tsvector, tsquery)](https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-RANKING)
+tsvector.RankCoverDensity(tsquery) | [ts_rank_cd(tsvector, tsquery)](https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-RANKING)
+tsvector.SetWeight(NpgsqlTsVector.Lexeme.Weight.A) | [setweight(tsvector, 'A')](https://www.postgresql.org/docs/current/static/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSVECTOR)
+tsvector.ToStripped() | [strip(tsvector)](https://www.postgresql.org/docs/current/functions-textsearch.html#TEXTSEARCH-FUNCTIONS-TABLE)
+EF.Functions.Unaccent(string) | [unaccent(string)](https://www.postgresql.org/docs/current/unaccent.html)
+EF.Functions.Unaccent(regdictionary, string) | [unaccent(regdictionary, string)](https://www.postgresql.org/docs/current/unaccent.html)
diff --git a/docs/mapping/general.md b/docs/mapping/general.md
new file mode 100644
index 0000000000..7734fe3982
--- /dev/null
+++ b/docs/mapping/general.md
@@ -0,0 +1,41 @@
+# Type mapping
+
+The EF Core provider transparently maps the types supported by Npgsql at the ADO.NET level - see [the Npgsql ADO type mapping page](/doc/types/basic.html).
+
+This means that you can use PostgreSQL-specific types, such as `inet` or `circle`, directly in your entities. Simply define your properties just as if they were a simple type, such as a `string`:
+
+```csharp
+public class MyEntity
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public IPAddress IPAddress { get; set; }
+ public NpgsqlCircle Circle { get; set; }
+ public int[] SomeInts { get; set; }
+}
+```
+
+Special types such as [arrays](array.md) and [enums](enum.md) have their own documentation pages with more details.
+
+[PostgreSQL composite types](https://www.postgresql.org/docs/current/static/rowtypes.html), while supported at the ADO.NET level, aren't yet supported in the EF Core provider. This is tracked by [#22](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/22).
+
+## Explicitly specifying data types
+
+In some cases, your .NET property type can be mapped to several PostgreSQL data types; a good example is a `string`, which will be mapped to `text` by default, but can also be mapped to `jsonb`. You can use either Data Annotation attributes or the Fluent API to configure the PostgreSQL data type:
+
+## [Data Annotations](#tab/data-annotations)
+
+```csharp
+[Column(TypeName="jsonb")]
+public string SomeStringProperty { get; set; }
+```
+
+## [Fluent API](#tab/fluent-api)
+
+```csharp
+builder.Entity()
+ .Property(b => b.SomeStringProperty)
+ .HasColumnType("jsonb");
+```
+
+***
diff --git a/docs/mapping/json.md b/docs/mapping/json.md
new file mode 100644
index 0000000000..09df8eef5c
--- /dev/null
+++ b/docs/mapping/json.md
@@ -0,0 +1,340 @@
+# JSON Mapping
+
+> [!NOTE]
+> Version 8.0 of the Npgsql provider introduced support for EF's [JSON columns](https://learn.microsoft.com/ef/core/what-is-new/ef-core-7.0/whatsnew#json-columns), using `ToJson()`. That is the recommended way to map POCOs going forward.
+
+PostgreSQL has rich, built-in support for storing JSON columns and efficiently performing complex queries operations on them. Newcomers can read more about the PostgreSQL support on [the JSON types page](https://www.postgresql.org/docs/current/datatype-json.html), and on the [functions and operators page](https://www.postgresql.org/docs/current/functions-json.html). Note that the below mapping mechanisms support both the `jsonb` and `json` types, although the former is almost always preferred for efficiency reasons.
+
+The Npgsql EF Core provider allows you to map PostgreSQL JSON columns in three different ways:
+
+1. As simple strings
+2. As EF owned entities
+3. As System.Text.Json DOM types (JsonDocument or JsonElement, [see docs](https://learn.microsoft.com/dotnet/standard/serialization/system-text-json/use-dom#use-jsondocument))
+4. As strongly-typed user-defined types (POCOs) (deprecated)
+
+## String mapping
+
+The simplest form of mapping to JSON is via a regular string property, just like an ordinary text column:
+
+### [Data Annotations](#tab/data-annotations)
+
+```csharp
+public class SomeEntity
+{
+ public int Id { get; set; }
+ [Column(TypeName = "jsonb")]
+ public string Customer { get; set; }
+}
+```
+
+### [Fluent API](#tab/fluent-api)
+
+```csharp
+class MyContext : DbContext
+{
+ public DbSet SomeEntities { get; set; }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity()
+ .Property(b => b.Customer)
+ .HasColumnType("jsonb");
+ }
+}
+
+public class SomeEntity
+{
+ public int Id { get; set; }
+ public string Customer { get; set; }
+}
+```
+
+***
+
+With string mapping, the EF Core provider will save and load properties to database JSON columns, but will not do any further serialization or parsing - it's the developer's responsibility to handle the JSON contents, possibly using System.Text.Json to parse them. This mapping approach is more limited compared to the others.
+
+## POCO mapping
+
+If your column JSON contains documents with a stable schema, you can map them to your own .NET types (or POCOs); EF will use System.Text.Json APIs under the hood to serialize instances of your types to JSON documents before sending them to the database, and to deserialize documents coming back from the database. This effectively allows mapping an arbitrary .NET type - or object graph - to a single column in the database.
+
+As of EF 10, the recommended way to map .NET types to JSON in the database is via complex types ([see EF release notes](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-10.0/whatsnew#json)). In this mode, EF is fully aware of the structure of your JSON document - just like it's aware of your tables and columns - and provides powerful, rich querying and updating capabilities. Prior to EF 10, similar modeling was available via the "owned entity" concept, but this modeling created several issues ([see here for more details](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-10.0/whatsnew#json)). If you're using EF 10 or above, complex types are the recommended way to map .NET types.
+
+As an 3rd alternative, prior to version 8.0, the Npgsql EF provider has supported JSON POCO mapping by simply delegating serialization/deserialization to System.Text.Json; in this mode, EF itself is oblivious to the contents of the JSON document, and cannot take that structure into account for queries and updates. This approach can now be considered deprecated as it allows for less powerful mapping and supports less query types; using complex types with `ToJson()` is now the recommended way to map POCOs to JSON.
+
+### EF modeling with ToJson (recommended)
+
+Npgsql's support for `ToJson()` is fully aligned with the general EF support; see the [EF documentation for more information](https://learn.microsoft.com/ef/core/what-is-new/ef-core-10.0/whatsnew#json).
+
+To get you started quickly, assume that we have the following Customer type, with a Details property that we want to map to a single JSON column in the database:
+
+```csharp
+public class Customer
+{
+ public int Id { get; set; }
+ public CustomerDetails Details { get; set; }
+}
+
+public class CustomerDetails // Map to a JSON column in the table
+{
+ public string Name { get; set; }
+ public int Age { get; set; }
+ public List Orders { get; set; }
+}
+
+public class Order // Part of the JSON column
+{
+ public decimal Price { get; set; }
+ public string ShippingAddress { get; set; }
+}
+```
+
+To instruct EF to map CustomerDetails - and within it, Order - to a JSON column, configure it as follows:
+
+#### [Complex types (EF10+)](#tab/complex-types)
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity()
+ .ComplexProperty(c => c.Details, d => d.ToJson());
+}
+```
+
+#### [Owned entities](#tab/owned-entities)
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity()
+ .OwnsOne(c => c.Details, d =>
+ {
+ d.ToJson();
+ d.OwnsMany(d => d.Orders);
+ });
+}
+```
+
+***
+
+At this point you can interact with the Customer just like you would normally, and EF will seamlessly serialize and deserialize it to a JSON column in the database. You can also perform LINQ queries which reference properties inside the JSON document, and these will get translated to SQL.
+
+### Legacy POCO mapping (deprecated)
+
+Before version 8.0 introduced support for EF's ToJson (owned entity mapping), the provider had its own support for JSON POCO mapping, by simply delegating serialization/deserialization to System.Text.Json; in this model, EF itself model the contents of the JSON document, and cannot take that structure into account for queries and updates. This approach can now be considered deprecated as it allows for less powerful mapping and supports less query types; using ToJson() is now the recommended way to map POCOs to JSON.
+
+To use legacy POCO mapping, configure a property a mapping to map to a `jsonb` column as follows:
+
+#### [Data Annotations](#tab/data-annotations)
+
+```csharp
+public class Customer
+{
+ public int Id { get; set; }
+ [Column(TypeName = "jsonb")]
+ public CustomerDetails Details { get; set; }
+}
+
+public class CustomerDetails // Mapped to a JSON column in the table
+{
+ public string Name { get; set; }
+ public int Age { get; set; }
+ public Order[] Orders { get; set; }
+}
+
+public class Order // Part of the JSON column
+{
+ public decimal Price { get; set; }
+ public string ShippingAddress { get; set; }
+}
+```
+
+#### [Fluent API](#tab/fluent-api)
+
+```csharp
+class MyContext : DbContext
+{
+ public DbSet SomeEntities { get; set; }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity()
+ .Property(b => b.Customer)
+ .HasColumnType("jsonb");
+ }
+}
+
+public class SomeEntity // Mapped to a database table
+{
+ public int Id { get; set; }
+ public Customer Customer { get; set; }
+}
+
+public class Customer // Mapped to a JSON column in the table
+{
+ public string Name { get; set; }
+ public int Age { get; set; }
+ public Order[] Orders { get; set; }
+}
+
+public class Order // Part of the JSON column
+{
+ [JsonPropertyName("OrderPrice")] // Controls the JSON property name
+ public decimal Price { get; set; }
+ public string ShippingAddress { get; set; }
+}
+```
+
+Note that when using this mapping, only limited forms of LINQ querying is supported; it's recommended to switch to ToJson() for full LINQ querying capabilities. The querying supported by traditional POCO mapping is documented [below](#querying-traditional-and-dom).
+
+***
+
+## JsonDocument DOM mapping
+
+If your column JSON schema isn't stable, a strongly-typed POCO mapping may not be appropriate. The Npgsql provider also allows you to map the DOM document type provided by [System.Text.Json APIs](https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-apis/).
+
+```csharp
+public class SomeEntity : IDisposable
+{
+ public int Id { get; set; }
+ public JsonDocument Customer { get; set; }
+
+ public void Dispose() => Customer?.Dispose();
+}
+```
+
+Note that neither a data annotation nor the fluent API are required, as [JsonDocument](https://docs.microsoft.com/dotnet/api/system.text.json.jsondocument) is automatically recognized and mapped to `jsonb`. Note also that `JsonDocument` is disposable, so the entity type is made disposable as well; not dispose the `JsonDocument` will result in the memory not being returned to the pool, which will increase GC impact across various parts of the framework.
+
+Once a document is loaded from the database, you can traverse it:
+
+```csharp
+var someEntity = context.Entities.First();
+Console.WriteLine(someEntity.Customer.RootElement.GetProperty("Orders")[0].GetProperty("Price").GetInt32());
+```
+
+Note that when using this mapping, only limited forms of LINQ querying is supported; [see below](#querying-traditional-and-dom) for more details.
+
+## Querying JSON columns (DOM and legacy POCO)
+
+> [!NOTE]
+> The below does not apply if you are using ToJson (owned entity mapping). ToJson mapping supports far more querying patterns than both legacy POCO and DOM and should be preferred.
+
+Saving and loading documents these documents wouldn't be much use without the ability to query them. You can express your queries via the same LINQ constructs you are already using in EF Core:
+
+### [JsonDocument Mapping](#tab/jsondocument)
+
+```csharp
+var joes = context.CustomerEntries
+ .Where(e => e.Customer.RootElement.GetProperty("Name").GetString() == "Joe")
+ .ToList();
+```
+
+### [Legacy POCO Mapping](#tab/poco)
+
+```csharp
+var joes = context.CustomerEntries
+ .Where(e => e.Customer.Name == "Joe")
+ .ToList();
+```
+
+***
+
+The provider will recognize the traversal of a JSON document, and translate it to the correspond PostgreSQL JSON traversal operator, producing the following PostgreSQL-specific SQL:
+
+```sql
+SELECT c.""Id"", c.""Customer""
+FROM ""CustomerEntries"" AS c
+WHERE c.""Customer""->>'Name' = 'Joe'
+```
+
+[If indexes are set up properly](#indexing-json-columns), this can result in very efficient, server evaluation of searches with database JSON documents.
+
+The following expression types and functions are translated:
+
+### [JsonDocument Mapping](#tab/jsondocument)
+
+.NET | SQL
+------------------------------------------------------------------------------------- | ----
+customer.RootElement.GetProperty("Name").GetString() | [customer->>'Name' = 'Joe'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-OP-TABLE)
+customer.RootElement.GetProperty("Orders")[1].GetProperty("Price").GetInt32() | [CAST(customer #>> '{Orders,1,Price}' AS integer) = 8](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-OP-TABLE)
+customer.RootElement.GetProperty("Orders").GetArrayLength() | [jsonb_array_length(customer->'Orders'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE)
+EF.Functions.JsonContains(customer, @"{""Name"": ""Joe"", ""Age"": 25}")1 | [customer @> '{"Name": "Joe", "Age": 25}'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonContained(@"{""Name"": ""Joe"", ""Age"": 25}", customer)1 | ['{"Name": "Joe", "Age": 25}' <@ customer](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonExists(customer, "Age") | [customer ? 'Age'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonExistAny(customer, "Age", "Address") | [customer ?\| ARRAY\['Age','Address'\]](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonExistAll(customer, "Age", "Address") | [customer ?& ARRAY\['Age','Address'\]](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonTypeof(customer.GetProperty("Age")) == "number" | [jsonb_typeof(customer->'Age') = 'number'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE)
+
+### [Legacy POCO Mapping](#tab/poco)
+
+.NET | SQL
+--------------------------------------------------------------------------------------- | ----
+customer.Name | [customer->>'Name'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-OP-TABLE)
+customer.Orders[1].Price | [customer#>>'{Orders,0,Price}'\[1\]](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-OP-TABLE)
+customer.Orders.Length (or Count) | [jsonb_array_length(customer->'Orders')](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE)
+EF.Functions.JsonContains(customer, @"{""Name"": ""Joe"", ""Age"": 25}")1 | [customer @> '{"Name": "Joe", "Age": 25}'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonContained(@"{""Name"": ""Joe"", ""Age"": 25}", e.Customer)1 | ['{"Name": "Joe", "Age": 25}' <@ customer](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonExists(e.Customer, "Age") | [customer ? 'Age'](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonExistAny(e.Customer, "Age", "Address") | [customer ?\| ARRAY\['Age','Address'\]](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonExistAll(e.Customer, "Age", "Address") | [customer ?& ARRAY\['Age','Address'\]](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE)
+EF.Functions.JsonTypeof(e.Customer.Age) | [jsonb_typeof(customer->'Age')](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE)
+
+***
+
+1 JSON functions which accept a .NET object will not accept .NET scalar values. For example, to pass a scalar to `JsonContains` wrap it in a `JsonElement` or alternatively wrap it in a string. Note: a root level JSON string value requires quotes and escaping `@"""Joe"""`, just as any nested JSON string value would.
+
+## Indexing JSON columns
+
+Choose an index based on the operators used by your queries: targeted B-tree expression indexes support comparisons on extracted scalar values, while GIN indexes support matching containment, key-existence and JSON-path predicates over `jsonb` values.
+
+### Indexing members with ToJson
+
+> [!NOTE]
+> Indexing JSON members was introduced in EF 11.
+
+You can use the existing `HasIndex` APIs to index members of complex types mapped with `ToJson()`. Using the Customer model above:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity(b =>
+ {
+ b.ComplexProperty(c => c.Details, d => d.ToJson());
+
+ b.HasIndex(c => c.Details.Name).IsUnique();
+ b.HasIndex(c => new { c.Details.Name, c.Details.Age });
+ b.HasIndex(c => c.Details.Orders[0].Price);
+ });
+}
+```
+
+By default, these produce B-tree expression indexes over the selected members, not indexes over the entire JSON document. The expressions extract values with the same conversions as LINQ queries; for example, `Name` is extracted as text, while `Age` is cast to an integer. These indexes can support equality and range comparisons, ordering, and uniqueness where applicable.
+
+Nested paths, configured JSON property names, fixed collection positions (such as `Orders[0].Price`) and array values themselves are supported. Composite member indexes must refer to the same JSON column. Existing index options, such as sort order and the [PostgreSQL-specific index configuration](../modeling/indexes.md), also apply.
+
+The following limitations apply:
+
+* Wildcard traversal to descendants of all collection elements is not supported; selecting a fixed position does not index that member in every element.
+* EF does not allow combining JSON member keys with regular column keys or members from multiple JSON columns, or creating unique indexes over entire JSON complex objects.
+* Nested JSON member indexes cannot be combined with `IsTsVectorExpressionIndex`.
+* PostgreSQL requires index expressions to be `IMMUTABLE`. Some native date/time and enum casts are not immutable, so PostgreSQL rejects indexes whose expressions require those casts.
+
+### GIN indexes
+
+Whole-document GIN indexes remain supported as before. You can also explicitly select GIN for an array or subdocument within a `jsonb` column:
+
+```csharp
+modelBuilder.Entity()
+ .HasIndex(c => c.Details)
+ .HasMethod("gin");
+
+modelBuilder.Entity()
+ .HasIndex(c => c.Details.Orders)
+ .HasMethod("gin")
+ .HasOperators("jsonb_path_ops");
+```
+
+A whole-document GIN index can cover predicates on many properties, while a targeted index covers a selected expression. Queries must use matching expressions and operators: a GIN index on the document does not accelerate ordinary comparisons on extracted scalars, such as `c.Details.Age > 18`. Similarly, an index on `Details.Orders` serves supported predicates on that array, not arbitrary comparisons on each order's `Price`.
+
+The default `jsonb_ops` GIN operator class supports containment, key-existence and JSON-path operators. The alternative `jsonb_path_ops` supports containment and JSON-path operators, but not key-existence operators (`?`, `?|`, `?&`). A document-wide GIN index is not necessarily smaller or cheaper to maintain than targeted B-tree indexes; choose based on your queries and workload.
+
+See [PostgreSQL's JSON indexing documentation](https://www.postgresql.org/docs/current/datatype-json.html#JSON-INDEXING) for details on supported operators and index tradeoffs.
diff --git a/docs/mapping/nodatime.md b/docs/mapping/nodatime.md
new file mode 100644
index 0000000000..d17b8ef461
--- /dev/null
+++ b/docs/mapping/nodatime.md
@@ -0,0 +1,140 @@
+# Date/Time Mapping with NodaTime
+
+## What is NodaTime
+
+By default, [the PostgreSQL date/time types](https://www.postgresql.org/docs/current/static/datatype-datetime.html) are mapped to the built-in .NET types (`DateTime`, `TimeSpan`). Unfortunately, these built-in types are flawed in many ways. The [NodaTime library](http://nodatime.org/) was created to solve many of these problems, and if your application handles dates and times in anything but the most basic way, you should consider using it. To learn more [read this blog post by Jon Skeet](http://blog.nodatime.org/2011/08/what-wrong-with-datetime-anyway.html).
+
+Beyond NodaTime's general advantages, some specific advantages NodaTime for PostgreSQL date/time mapping include:
+
+* NodaTime defines some types which are missing from the BCL, such as `LocalDate`, `LocalTime`, and `OffsetTime`. These cleanly correspond to PostgreSQL `date`, `time` and `timetz`.
+* `Period` is much more suitable for mapping PostgreSQL `interval` than `TimeSpan`.
+* NodaTime types can fully represent PostgreSQL's microsecond precision, and can represent dates outside the BCL's date limit (1AD-9999AD).
+
+## Setup
+
+To set up the NodaTime plugin, add the [Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime nuget](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime) to your project. Then, configure the NodaTime plugin as follows:
+
+### [EF 9.0, with a connection string](#tab/ef9-with-connection-string)
+
+If you're passing a connection string to `UseNpgsql`, simply add the `UseNodaTime` call as follows:
+
+```csharp
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ "",
+ o => o.UseNodaTime()));
+```
+
+This configures all aspects of Npgsql to use the NodaTime plugin - both at the EF and the lower-level Npgsql layer.
+
+### [With an external NpgsqlDataSource](#tab/with-datasource)
+
+If you're creating an external NpgsqlDataSource and passing it to `UseNpgsql`, you must call `UseNodaTime` on your NpgsqlDataSourceBuilder independently of the EF-level setup:
+
+```csharp
+var dataSourceBuilder = new NpgsqlDataSourceBuilder("");
+dataSourceBuilder.UseNodaTime();
+var dataSource = dataSourceBuilder.Build();
+
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ dataSource,
+ o => o.UseNodaTime()));
+```
+
+### [Older EF versions, with a connection string](#tab/legacy-with-connection-string)
+
+```csharp
+// Configure UseNodaTime at the ADO.NET level.
+// This code must be placed at the beginning of your application, before any other Npgsql API is called; an appropriate place for this is in the static constructor on your DbContext class:
+static MyDbContext()
+ => NpgsqlConnection.GlobalTypeMapper.UseNodaTime();
+
+// Then, when configuring EF Core with UseNpgsql(), call UseNodaTime():
+builder.Services.AddDbContext(options =>
+ options.UseNpgsql("", o => o.UseNodaTime()));
+```
+
+***
+
+The above sets up all the necessary mappings and operation translators. You can now use NodaTime types as regular properties in your entities, and even perform some operations:
+
+```csharp
+public class Post
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public Instant CreationTime { get; set; }
+}
+
+var recentPosts = context.Posts.Where(p => p.CreationTime > someInstant);
+```
+
+## Operation translation
+
+The provider knows how to translate many members and methods on mapped NodaTime types. For example, the following query will be translated to SQL and evaluated server-side:
+
+```csharp
+// Get all events which occurred on a Monday
+var mondayEvents = context.Events.Where(p => p.SomeDate.DayOfWeek == DayOfWeek.Monday);
+
+// Get all events which occurred before the year 2000
+var oldEvents = context.Events.Where(p => p.SomeDate.Year < 2000);
+```
+
+Following is the list of supported NodaTime translations; If an operation you need is missing, please open an issue to request for it.
+
+Starting with version 11.0, `EF.Functions.DateTrunc()` supports `LocalDateTime`, `Instant`, `ZonedDateTime`, `Period` and `Duration`. Its optional time zone argument is only supported for `Instant` and `ZonedDateTime` mapped to `timestamp with time zone`; without that argument, PostgreSQL uses the session time zone for these values.
+
+.NET | SQL | Notes
+-------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -----------
+SystemClock.Instance.GetCurrentInstant() | [now()](https://www.postgresql.org/docs/current/functions-datetime.html) |
+EF.Functions.DateTrunc("month", value) | [date_trunc('month', value)](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 11.0
+EF.Functions.DateTrunc("month", instant, "Europe/Berlin") | [date_trunc('month', instant, 'Europe/Berlin')](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 11.0
+LocalDateTime.Date | [date_trunc('day', timestamp)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.Second (also LocalTime, ZonedDateTime) | [date_part('second', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.Minute (also LocalTime, ZonedDateTime) | [date_part('minute', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.Hour (also LocalTime, ZonedDateTime) | [date_part('hour', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.Day, (also LocalDate, ZonedDateTime) | [date_part('day', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.Month (also LocalDate, ZonedDateTime) | [date_part('month', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.Year (also LocalDate, ZonedDateTime) | [date_part('year', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.DayOfWeek (also LocalDate, ZonedDateTime) | [floor(date_part('dow', timestamp))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDateTime.DayOfYear (also LocalDate, ZonedDateTime) | [date_part('doy', timestamp)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+LocalDate.At(time) | [date + time](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 10.0
+LocalDate.AtMidnight() | [date + '00:00:00'](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 10.0
+Period.Seconds (also Duration) | [date_part('second', interval)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.Minutes (also Duration) | [date_part('minute', interval)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.Hours (also Duration) | [date_part('hour', interval)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.Days (also Duration) | [date_part('day', interval)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.Months | [date_part('month', interval)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.Years | [date_part('year', interval)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromSeconds | [make_interval(seconds => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromMinutes | [make_interval(minutes => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromHours | [make_interval(hours => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromDays | [make_interval(days => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromWeeks | [make_interval(weeks => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromMonths | [make_interval(months => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Period.FromYears | [make_interval(years => int)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Duration.TotalMilliseconds | [date_part('epoch', interval) / 0.001](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Duration.TotalSeconds | [date_part('epoch', interval)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Duration.TotalMinutes | [date_part('epoch', interval) / 60.0](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Duration.TotalDays | [date_part('epoch', interval) / 86400.0](https://www.postgresql.org/docs/current/functions-datetime.html) |
+Duration.TotalHours | [date_part('epoch', interval) / 3600.0](https://www.postgresql.org/docs/current/functions-datetime.html) |
+ZonedDateTime.LocalDateTime | [timestamptz AT TIME ZONE 'UTC'](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) |
+DateInterval.Length | [upper(daterange) - lower(daterange)](https://www.postgresql.org/docs/current/functions-range.html) |
+DateInterval.Start | [lower(daterange)](https://www.postgresql.org/docs/current/functions-range.html) |
+DateInterval.End | [upper(daterange) - INTERVAL 'P1D'](https://www.postgresql.org/docs/current/functions-range.html) |
+DateInterval.Contains(LocalDate) | [daterange @> date](https://www.postgresql.org/docs/current/functions-range.html) |
+DateInterval.Contains(DateInterval) | [daterange @> daterange](https://www.postgresql.org/docs/current/functions-range.html) |
+DateInterval.Intersection(DateInterval) | [daterange * daterange](https://www.postgresql.org/docs/current/functions-range.html) |
+DateInterval.Union(DateInterval) | [daterange + daterange](https://www.postgresql.org/docs/current/functions-range.html) |
+Instant.InZone(DateTimeZoneProviders.Tzdb["Europe/Berlin"]).LocalDateTime | [timestamptz AT TIME ZONE 'Europe/Berlin'](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) |
+LocalDateTime.InZoneLeniently(DateTimeZoneProviders.Tzdb["Europe/Berlin"]).ToInstant() | [timestamp AT TIME ZONE 'Europe/Berlin'](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) |
+ZonedDateTime.ToInstant | No PG operation (.NET-side conversion from ZonedDateTime to Instant only) |
+Instant.InUtc | No PG operation (.NET-side conversion from Instant to ZonedDateTime only) |
+Instant.ToDateTimeUtc | No PG operation (.NET-side conversion from Instant to UTC DateTime only) |
+LocalDateTime.ToDateTimeUnspecified() | No PG operation (timestamp without time zone is unchanged) | Added in 11.0
+EF.Functions.Sum(periods) | [sum(periods)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](translations.md#aggregate-functions).
+EF.Functions.Sum(durations) | [sum(durations)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](translations.md#aggregate-functions).
+EF.Functions.Average(periods) | [avg(durations)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](translations.md#aggregate-functions).
+EF.Functions.Average(durations) | [avg(durations)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](translations.md#aggregate-functions).
+
+In addition to the above, most arithmetic operators are also translated (e.g. LocalDate + Period).
diff --git a/docs/mapping/nts.md b/docs/mapping/nts.md
new file mode 100644
index 0000000000..57401136c5
--- /dev/null
+++ b/docs/mapping/nts.md
@@ -0,0 +1,194 @@
+# Spatial Mapping with NetTopologySuite
+
+> [!NOTE]
+> It's recommended that you start by reading the general [Entity Framework Core docs on spatial support](https://docs.microsoft.com/ef/core/modeling/spatial).
+
+PostgreSQL supports spatial data and operations via [the PostGIS extension](https://postgis.net/), which is a mature and feature-rich database spatial implementation. .NET doesn't provide a standard spatial library, but [NetTopologySuite](https://github.com/NetTopologySuite/NetTopologySuite) is a leading spatial library. The Npgsql EF Core provider has a plugin which allows you to map the NTS types to PostGIS columns, allowing seamless reading and writing. This is the recommended way to interact with spatial types in Npgsql.
+
+Note that the EF Core NetTopologySuite plugin depends on [the Npgsql ADO.NET NetTopology plugin](http://www.npgsql.org/doc/types/nts.html), which provides NetTopologySuite support at the lower level.
+
+## Setup
+
+To use the NetTopologySuite plugin, add the [Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite nuget](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite) to your project. Then, configure the NetTopologySuite plugin as follows:
+
+### [EF 9.0, with a connection string](#tab/ef9-with-connection-string)
+
+If you're passing a connection string to `UseNpgsql`, simply add the `UseNetTopologySuite` call as follows:
+
+```csharp
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ "",
+ o => o.UseNetTopologySuite()));
+```
+
+This configures all aspects of Npgsql to use the NetTopologySuite plugin - both at the EF and the lower-level Npgsql layer.
+
+### [With an external NpgsqlDataSource](#tab/with-datasource)
+
+If you're creating an external NpgsqlDataSource and passing it to `UseNpgsql`, you must call `UseNetTopologySuite` on your NpgsqlDataSourceBuilder independently of the EF-level setup:
+
+```csharp
+var dataSourceBuilder = new NpgsqlDataSourceBuilder("");
+dataSourceBuilder.UseNetTopologySuite();
+var dataSource = dataSourceBuilder.Build();
+
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ dataSource,
+ o => o.UseNetTopologySuite()));
+```
+
+### [Older EF versions, with a connection string](#tab/legacy-with-connection-string)
+
+```csharp
+// Configure NetTopologySuite at the ADO.NET level.
+// This code must be placed at the beginning of your application, before any other Npgsql API is called; an appropriate place for this is in the static constructor on your DbContext class:
+static MyDbContext()
+ => NpgsqlConnection.GlobalTypeMapper.UseNetTopologySuite();
+
+// Then, when configuring EF Core with UseNpgsql(), call UseNetTopologySuite():
+builder.Services.AddDbContext(options =>
+ options.UseNpgsql("", o => o.UseNetTopologySuite()));
+```
+
+***
+
+The above sets up all the necessary EF mappings and operation translators. If you're using EF 6.0, you also need to make sure that the PostGIS extension is installed in your database (later versions do this automatically). Add the following to your DbContext:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder builder)
+{
+ builder.HasPostgresExtension("postgis");
+}
+```
+
+At this point spatial support is set up. You can now use NetTopologySuite types as regular properties in your entities, and even perform some operations:
+
+```csharp
+public class City
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public Point Location { get; set; }
+}
+
+var nearbyCities = context.Cities.Where(c => c.Location.Distance(somePoint) < 100);
+```
+
+## Constraining your type names
+
+With the code above, the provider will create a database column of type `geometry`. This is perfectly fine, but be aware that this type accepts any geometry type (point, polygon...), with any coordinate system (XY, XYZ...). It's good practice to constrain the column to the exact type of data you will be storing, but unfortunately the provider isn't aware of your required coordinate system and therefore can't do that for you. Consider explicitly specifying your column types on your properties as follows:
+
+```csharp
+[Column(TypeName="geometry (point)")]
+public Point Location { get; set; }
+```
+
+This will constrain your column to XY points only. The same can be done via the fluent API with `HasColumnType()`.
+
+## Geography (geodetic) support
+
+PostGIS has two types: `geometry` (for Cartesian coordinates) and `geography` (for geodetic or spherical coordinates). You can read about the geometry/geography distinction [in the PostGIS docs](https://postgis.net/docs/manual-2.4/using_postgis_dbmanagement.html#PostGIS_Geography) or in [this blog post](http://workshops.boundlessgeo.com/postgis-intro/geography.html). In a nutshell, `geography` is much more accurate when doing calculations over long distances, but is more expensive computationally and supports only a small subset of the spatial operations supported by `geometry`.
+
+The Npgsql provider will be default map all NetTopologySuite types to PostGIS `geometry`. However, you can instruct it to map certain properties to `geography` instead:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder builder)
+{
+ builder.Entity().Property(b => b.Location).HasColumnType("geography (point)");
+}
+```
+
+or via an attribute:
+
+```csharp
+public class City
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ [Column(TypeName="geography")]
+ public Point Location { get; set; }
+}
+```
+
+Once you do this, your column will be created as `geography`, and spatial operations will behave as expected.
+
+## Operation translation
+
+The following table lists NetTopologySuite operations which are translated to PostGIS SQL operations. This allows you to use these NetTopologySuite methods and members efficiently - evaluation will happen on the server side. Since evaluation happens at the server, table data doesn't need to be transferred to the client (saving bandwidth), and in some cases indexes can be used to speed things up.
+
+Note that the plugin is far from covering all spatial operations. If an operation you need is missing, please open an issue to request for it.
+
+.NET | SQL | Notes
+---------------------------------------------------------------- |------------------------------------------------------------------------------------- | -----
+geom.Area() | [ST_Area(geom)](https://postgis.net/docs/ST_Area.html)
+geom.AsBinary() | [ST_AsBinary(geom)](https://postgis.net/docs/ST_AsBinary.html)
+geom.AsText() | [ST_AsText(geom)](https://postgis.net/docs/ST_AsText.html)
+geom.Boundary | [ST_Boundary(geom)](https://postgis.net/docs/ST_Boundary.html)
+geom.Buffer(d) | [ST_Buffer(geom,d)](https://postgis.net/docs/ST_Buffer.html)
+geom.Centroid | [ST_Centroid(geom)](https://postgis.net/docs/ST_Centroid.html)
+geom1.Contains(geom2) | [ST_Contains(geom1, geom2)](https://postgis.net/docs/ST_Contains.html)
+geomCollection.Count | [ST_NumGeometries(geom1)](https://postgis.net/docs/ST_NumGeometries.html)
+linestring.Count | [ST_NumPoints(linestring)](https://postgis.net/docs/ST_NumPoints.html)
+geom1.ConvexHull() | [ST_ConvexHull(geom1)](https://postgis.net/docs/ST_ConvexHull.html)
+geom1.Covers(geom2) | [ST_Covers(geom1, geom2)](https://postgis.net/docs/ST_Covers.html)
+geom1.CoveredBy(geom2) | [ST_CoveredBy(geom1, geom2)](https://postgis.net/docs/ST_CoveredBy.html)
+geom1.Crosses(geom2) | [ST_Crosses(geom1, geom2)](https://postgis.net/docs/ST_Crosses.html)
+geom1.Difference(geom2) | [ST_Difference(geom1, geom2)](https://postgis.net/docs/ST_Difference.html)
+geom1.Dimension | [ST_Dimension(geom1)](https://postgis.net/docs/ST_Dimension.html)
+geom1.Disjoint(geom2) | [ST_Disjoint(geom1, geom2)](https://postgis.net/docs/ST_Disjoint.html)
+geom1.Distance(geom2) | [ST_Distance(geom1, geom2)](https://postgis.net/docs/ST_Distance.html)
+EF.Functions.DistanceKnn(geom1, geom2) | [geom1 <-> geom2](https://postgis.net/docs/geometry_distance_knn.html)
+EF.Functions.Distance(geom1, geom2, useSpheriod) | [ST_Distance(geom1, geom2, useSpheriod)](https://postgis.net/docs/ST_Distance.html)
+geom1.Envelope | [ST_Envelope(geom1)](https://postgis.net/docs/ST_Envelope.html)
+geom1.ExactEquals(geom2) | [ST_OrderingEquals(geom1, geom2)](https://postgis.net/docs/ST_OrderingEquals.html)
+lineString.EndPoint | [ST_EndPoint(lineString)](https://postgis.net/docs/ST_EndPoint.html)
+polygon.ExteriorRing | [ST_ExteriorRing(polygon)](https://postgis.net/docs/ST_ExteriorRing.html)
+geom1.Equals(geom2) | [geom1 = geom2](https://postgis.net/docs/ST_Geometry_EQ.html)
+geom1.Polygon.EqualsExact(geom2) | [geom1 = geom2](https://postgis.net/docs/ST_Geometry_EQ.html)
+geom1.EqualsTopologically(geom2) | [ST_Equals(geom1, geom2)](https://postgis.net/docs/ST_Equals.html)
+EF.Functions.Force2D | [ST_Force2D(geom)](https://postgis.net/docs/ST_Force2D.html)
+geom.GeometryType | [GeometryType(geom)](https://postgis.net/docs/GeometryType.html)
+geomCollection.GetGeometryN(i) | [ST_GeometryN(geomCollection, i)](https://postgis.net/docs/ST_GeometryN.html)
+linestring.GetPointN(i) | [ST_PointN(linestring, i)](https://postgis.net/docs/ST_PointN.html)
+geom1.Intersection(geom2) | [ST_Intersection(geom1, geom2)](https://postgis.net/docs/ST_Intersection.html)
+geom1.Intersects(geom2) | [ST_Intersects(geom1, geom2)](https://postgis.net/docs/ST_Intersects.html)
+EF.Functions.IntersectsBbox(geom1, geom2) | [geom1 && geom2](https://postgis.net/docs/geometry_overlaps.html) | Added in 11.0
+geom.InteriorPoint | [ST_PointOnSurface(geom)](https://postgis.net/docs/ST_PointOnSurface.html)
+lineString.IsClosed() | [ST_IsClosed(lineString)](https://postgis.net/docs/ST_IsClosed.html)
+geomCollection.IsEmpty() | [ST_IsEmpty(geomCollection)](https://postgis.net/docs/ST_IsEmpty.html)
+linestring.IsRing | [ST_IsRing(linestring)](https://postgis.net/docs/ST_IsRing.html)
+geom.IsWithinDistance(geom2,d) | [ST_DWithin(geom1, geom2, d)](https://postgis.net/docs/ST_DWithin.html)
+EF.Functions.IsWithinDistance(geom1, geom2, d, useSpheriod) | [ST_DWithin(geom1, geom2, d, useSpheriod)](https://postgis.net/docs/ST_DWithin.html)
+geom.IsSimple() | [ST_IsSimple(geom)](https://postgis.net/docs/ST_IsSimple.html)
+geom.IsValid() | [ST_IsValid(geom)](https://postgis.net/docs/ST_IsValid.html)
+lineString.Length | [ST_Length(lineString)](https://postgis.net/docs/ST_Length.html)
+EF.Functions.LineInterpolatePoint(lineString, fraction) | [ST_LineInterpolatePoint(lineString, fraction)](https://postgis.net/docs/ST_LineInterpolatePoint.html) | Added in 11.0
+EF.Functions.LineMerge(geom) | [ST_LineMerge(geom)](https://postgis.net/docs/ST_LineMerge.html) | Added in 11.0
+geom.Normalized | [ST_Normalize(geom)](https://postgis.net/docs/ST_Normalize.html)
+geomCollection.NumGeometries | [ST_NumGeometries(geomCollection)](https://postgis.net/docs/ST_NumGeometries.html)
+polygon.NumInteriorRings | [ST_NumInteriorRings(polygon)](https://postgis.net/docs/ST_NumInteriorRings.html)
+lineString.NumPoints | [ST_NumPoints(lineString)](https://postgis.net/docs/ST_NumPoints.html)
+geom1.Overlaps(geom2) | [ST_Overlaps(geom1, geom2)](https://postgis.net/docs/ST_Overlaps.html)
+geom.PointOnSurface | [ST_PointOnSurface(geom)](https://postgis.net/docs/ST_PointOnSurface.html)
+geom1.Relate(geom2) | [ST_Relate(geom1, geom2)](https://postgis.net/docs/ST_Relate.html)
+geom.Reverse() | [ST_Reverse(geom)](https://postgis.net/docs/ST_Reverse.html)
+EF.Functions.Scale(geom, xFactor, yFactor) | [ST_Scale(geom, xFactor, yFactor)](https://postgis.net/docs/ST_Scale.html) | Added in 11.0
+EF.Functions.Scale(geom, xFactor, yFactor, zFactor) | [ST_Scale(geom, xFactor, yFactor, zFactor)](https://postgis.net/docs/ST_Scale.html) | Added in 11.0
+EF.Functions.SetSrid(geom, srid) | [ST_SetSRID(geom, srid)](https://postgis.net/docs/ST_SetSRID.html) | Added in 11.0
+geom1.SRID | [ST_SRID(geom1)](https://postgis.net/docs/ST_SRID.html)
+lineString.StartPoint | [ST_StartPoint(lineString)](https://postgis.net/docs/ST_StartPoint.html)
+geom1.SymmetricDifference(geom2) | [ST_SymDifference(geom1, geom2)](https://postgis.net/docs/ST_SymDifference.html)
+geom.ToBinary() | [ST_AsBinary(geom)](https://postgis.net/docs/ST_AsBinary.html)
+geom.ToText() | [ST_AsText(geom)](https://postgis.net/docs/ST_AsText.html)
+geom1.Touches(geom2) | [ST_Touches(geom1, geom2)](https://postgis.net/docs/ST_Touches.html)
+EF.Functions.Transform(geom, srid) | [ST_Transform(geom, srid)](https://postgis.net/docs/ST_Transform.html)
+geom1.Union(geom2) | [ST_Union(geom1, geom2)](https://postgis.net/docs/ST_Union.html)
+geom1.Within(geom2) | [ST_Within(geom1, geom2)](https://postgis.net/docs/ST_Within.html)
+point.M | [ST_M(point)](https://postgis.net/docs/ST_M.html)
+point.X | [ST_X(point)](https://postgis.net/docs/ST_X.html)
+point.Y | [ST_Y(point)](https://postgis.net/docs/ST_Y.html)
+point.Z | [ST_Z(point)](https://postgis.net/docs/ST_Z.html)
+UnaryUnionOp.Union(geometries) | [ST_Union(geometries)](https://postgis.net/docs/ST_Union.html) | See [Aggregate functions](translations.md#aggregate-functions).
+GeometryCombiner.Combine(geometries) | [ST_Collect(geometries)](https://postgis.net/docs/ST_Collect.html) | See [Aggregate functions](translations.md#aggregate-functions).
+EnvelopeCombiner.CombineAsGeometry(geometries) | [ST_Extent(geometries)::geometry](https://postgis.net/docs/ST_Extent.html) | See [Aggregate functions](translations.md#aggregate-functions).
+ConvexHull.Create(geometries) | [ST_ConvexHull(geometries)](https://postgis.net/docs/ST_ConvexHull.html) | See [Aggregate functions](translations.md#aggregate-functions).
diff --git a/docs/mapping/range.md b/docs/mapping/range.md
new file mode 100644
index 0000000000..80393c915b
--- /dev/null
+++ b/docs/mapping/range.md
@@ -0,0 +1,99 @@
+# Ranges and Multiranges
+
+PostgreSQL has the unique feature of supporting [*range data types*](https://www.postgresql.org/docs/current/static/rangetypes.html). Ranges represent a range of numbers, dates or other data types, and allow you to easily query ranges which contain a value, perform set operations (e.g. query ranges which contain other ranges), and other similar operations. The range operations supported by PostgreSQL are listed [in this page](https://www.postgresql.org/docs/current/static/functions-range.html). The Npgsql EF Core provider allows you to seamlessly map PostgreSQL ranges, and even perform operations on them that get translated to SQL for server evaluation.
+
+In addition, PostgreSQL 14 introduced *multiranges*, which are basically sorted arrays of non-overlapping ranges with set-theoretic operations defined over them. Most range operators also work on multiranges, and they have a few functions of their own.
+
+## Ranges
+
+Npgsql maps PostgreSQL ranges to the generic CLR type `NpgsqlRange`:
+
+```csharp
+public class Event
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public NpgsqlRange Duration { get; set; }
+}
+```
+
+This will create a column of type `daterange` in your database. You can similarly have properties of type `NpgsqlRange`, `NpgsqlRange`, etc.
+
+## User-defined ranges
+
+PostgreSQL comes with 6 built-in ranges: `int4range`, `int8range`, `numrange`, `tsrange`, `tstzrange`, `daterange`; these can be used simply by adding the appropriate `NpgsqlRange` property in your entities as shown above. You can also define your own range types over arbitrary types, and use those in EF Core as well.
+
+To make the EF Core type mapper aware of your user-defined range, call the `MapRange()` method in your context's `OnConfiguring()` method as follows:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql(
+ "",
+ options => options.MapRange("floatrange"));
+```
+
+This allows you to have properties of type `NpgsqlRange`, which will be mapped to PostgreSQL `floatrange`.
+
+The above does *not* create the `floatrange` type for you. In order to do that, include the following in your context's `OnModelCreating()`:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.HasPostgresRange("floatrange", "real");
+```
+
+This will cause the appropriate [`CREATE TYPE ... AS RANGE`](https://www.postgresql.org/docs/current/static/sql-createtype.html) statement to be generated in your migrations, ensuring that your range is created and ready for use. Note that `HasPostgresRange()` supports additional parameters as supported by PostgreSQL `CREATE TYPE`.
+
+## Multiranges
+
+Npgsql maps arrays or lists of `NpgsqlRange` to PostgreSQL multiranges:
+
+```csharp
+public class Store
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public NpgsqlRange[] OpeningTimes { get; set; }
+}
+```
+
+## Operation translation
+
+Ranges can be queried via extensions methods on `NpgsqlRange`:
+
+```csharp
+var events = context.Events.Where(p => p.Duration.Contains(someDate));
+```
+
+This will translate to an SQL operation using the PostgreSQL `@>` operator, evaluating at the server and saving you from transferring the entire `Events` table to the client. Note that you can (and probably should) create indexes to make this operation more efficient, see the PostgreSQL docs for more info.
+
+The following table lists the range operations that currently get translated. Most operations work on both ranges and multiranges (starting with version 6.0.0); the multirange version is omitted for brevity.
+
+If you run into a missing operation, please open an issue.
+
+.NET | SQL
+--------------------------------------|-----
+range.LowerBound | [lower(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+range.UpperBound | [upper(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+range.LowerBoundIsInclusive | [lower_inc(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+range.UpperBoundIsInclusive | [upper_inc(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+range.LowerBoundIsInfinite | [lower_inf(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+range.UpperBoundIsInfinite | [upper_inf(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+range.IsEmpty | [isempty(range)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+multirange.Any() | [NOT is_empty(multirange)](https://www.postgresql.org/docs/current/functions-range.html#MULTIRANGE-FUNCTIONS-TABLE)
+range.Contains(i) | [range @> i](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.Contains(range2) | [range @> range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.ContainedBy(range2) | [range1 <@ range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.Overlaps(range2) | [range1 && range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.IsStrictlyLeftOf(range2) | [range1 << range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.IsStrictlyRightOf(range2) | [range1 >> range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.DoesNotExtendLeftOf(range2) | [range1 &> range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.DoesNotExtendRightOf(range2) | [range1 <& range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.IsAdjacentTo(range2) | [range1 -\|- range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.Union(range2) | [range1 + range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.Intersect(range2) | [range1 * range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.Except(range2) | [range1 - range2](https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE)
+range1.Merge(range2) | [range_merge(range1, range2)](https://www.postgresql.org/docs/current/functions-range.html#RANGE-FUNCTIONS-TABLE)
+multirange.Merge() | [range_merge(multirange)](https://www.postgresql.org/docs/current/functions-range.html#MULTIRANGE-FUNCTIONS-TABLE)
+ranges.RangeAgg() | [range_agg(ranges)](https://www.postgresql.org/docs/current/functions-aggregate.html)
+ranges.RangeIntersectAgg() | [range_intersect_agg(ranges)](https://www.postgresql.org/docs/current/functions-aggregate.html)
+multiranges.RangeIntersectAgg() | [range_intersect_agg(multiranges)](https://www.postgresql.org/docs/current/functions-aggregate.html) | See [Aggregate functions](translations.md#aggregate-functions).
diff --git a/docs/mapping/translations.md b/docs/mapping/translations.md
new file mode 100644
index 0000000000..f37f8d25aa
--- /dev/null
+++ b/docs/mapping/translations.md
@@ -0,0 +1,430 @@
+# Translations
+
+Entity Framework Core allows providers to translate query expressions to SQL for database evaluation. For example, PostgreSQL supports [regular expression operations](http://www.postgresql.org/docs/current/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP), and the Npgsql EF Core provider automatically translates .NET's [`Regex.IsMatch`](https://docs.microsoft.com/dotnet/api/system.text.regularexpressions.regex.ismatch) to use this feature. Since evaluation happens at the server, table data doesn't need to be transferred to the client (saving bandwidth), and in some cases indexes can be used to speed things up. The same C# code on other providers will trigger client evaluation.
+
+The Npgsql-specific translations are listed below. Some areas, such as [full-text search](full-text-search.md), have their own pages in this section which list additional translations.
+
+## String functions
+
+.NET | SQL | Notes
+------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------
+EF.Functions.Collate(operand, collation) | operand COLLATE collation
+EF.Functions.Like(matchExpression, pattern) | matchExpression LIKE pattern
+EF.Functions.Like(matchExpression, pattern, escapeCharacter) | matchExpression LIKE pattern ESCAPE escapeCharacter
+EF.Functions.ILike(matchExpression, pattern) | [matchExpression ILIKE pattern](../misc/collations-and-case-sensitivity.md)
+EF.Functions.ILike(matchExpression, pattern, escapeCharacter) | [matchExpression ILIKE pattern ESCAPE escapeCharacter](../misc/collations-and-case-sensitivity.md)
+string.Compare(strA, strB) | CASE WHEN strA = strB THEN 0 ... END
+string.Concat(str0, str1) | str0 \|\| str1
+string.IsNullOrEmpty(value) | value IS NULL OR value = ''
+string.IsNullOrWhiteSpace(value) | value IS NULL OR btrim(value, E' \t\n\r') = ''
+stringValue.CompareTo(strB) | CASE WHEN stringValue = strB THEN 0 ... END
+stringValue.Contains(value) | stringValue LIKE %value% | char overload added in 11.0
+stringValue.EndsWith(value) | stringValue LIKE '%' \|\| value | char overload added in 11.0
+stringValue.FirstOrDefault() | substr(stringValue, 1, 1)
+stringValue.IndexOf(value) | strpos(stringValue, value) - 1 | char overload added in 11.0
+stringValue.LastOrDefault() | substr(stringValue, length(stringValue), 1)
+stringValue.Length | length(stringValue)
+stringValue.PadLeft(length) | CASE WHEN length(stringValue) >= length THEN stringValue ELSE lpad(stringValue, length) END
+stringValue.PadLeft(length, char) | CASE WHEN length(stringValue) >= length THEN stringValue ELSE lpad(stringValue, length, char) END
+stringValue.PadRight(length) | CASE WHEN length(stringValue) >= length THEN stringValue ELSE rpad(stringValue, length) END
+stringValue.PadRight(length, char) | CASE WHEN length(stringValue) >= length THEN stringValue ELSE rpad(stringValue, length, char) END
+stringValue.Replace(oldValue, newValue) | replace(stringValue, oldValue, newValue) | char overload added in 11.0
+stringValue.StartsWith(value) | stringValue LIKE value \|\| '%' | char overload added in 11.0
+stringValue.Substring(startIndex, length) | substr(stringValue, startIndex + 1, @length)
+stringValue.ToLower() | lower(stringValue)
+stringValue.ToString() | stringValue | Null values remain null
+stringValue.ToUpper() | upper(stringValue)
+stringValue.Trim() | btrim(stringValue)
+stringValue.Trim(trimChar) | btrim(stringValue, trimChar)
+stringValue.TrimEnd() | rtrim(stringValue)
+stringValue.TrimEnd(trimChar) | rtrim(stringValue, trimChar)
+stringValue.TrimStart() | ltrim(stringValue)
+stringValue.TrimStart(trimChar) | ltrim(stringValue, trimChar)
+EF.Functions.Reverse(value) | reverse(value)
+Regex.IsMatch(stringValue, "^A+") | [stringValue ~ '^A+'](http://www.postgresql.org/docs/current/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP) (with options) | [1](#regex-note)
+Regex.IsMatch(stringValue, "^A+", regexOptions) | [stringValue ~ '^A+'](http://www.postgresql.org/docs/current/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP) (with options) | [1](#regex-note)
+Regex.Replace(stringValue, pattern, replacement) | [regexp_replace(stringValue, pattern, replacement, 'pg')](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP) | [1](#regex-note)
+Regex.Replace(stringValue, pattern, replacement, regexOptions) | [regexp_replace(stringValue, pattern, replacement, flags)](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP) | [1](#regex-note)
+Regex.Count(stringValue, pattern) | [regexp_count(stringValue, pattern, 1, 'p')](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP) | [1](#regex-note) Requires PostgreSQL 15+
+Regex.Count(stringValue, pattern, regexOptions) | [regexp_count(stringValue, pattern, 1, flags)](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP) | [1](#regex-note) Requires PostgreSQL 15+
+string.Join(", ", a, b) | [concat_ws(', ', a, b)](https://www.postgresql.org/docs/current/functions-string.html#FUNCTIONS-STRING-OTHER)
+string.Join(", ", array) | [array_to_string(array, ', ', '')](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE)
+string.Join(", ", agg_strings) | [string_agg(agg_strings, ', ')](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](#aggregate-functions).
+EF.Functions.StringToArray(s, "\|") | [string_agg(s, '\|')](https://www.postgresql.org/docs/current/functions-string.html#FUNCTION-STRING-TO-ARRAY)
+EF.Functions.StringToArray(s, "\|", "FOO") | [string_agg(s, '\|', 'FOO')](https://www.postgresql.org/docs/current/functions-string.html#FUNCTION-STRING-TO-ARRAY)
+
+1 These translations use [PostgreSQL's regular expression syntax and semantics](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP), not .NET's. In particular, unless `RegexOptions.Singleline` is specified, negated character classes such as `[^x]` do not match LF (`\n`), unlike in .NET: `a[^x]b` matches `"a\nb"` in .NET but not in PostgreSQL. Use client-side evaluation when exact .NET semantics are required.
+
+`RegexOptions` arguments must be constant, and `RightToLeft` and `ECMAScript` are not supported. Only `IgnoreCase`, `Multiline`, `Singleline` and `IgnorePatternWhitespace` affect the generated SQL. Only the listed static overloads are translated; instance methods, overloads accepting a match timeout or `MatchEvaluator`, and other `Regex` methods are not translated.
+
+## Date and time functions
+
+> [!NOTE]
+> Some of the operations below depend on the concept of a "local time zone" (e.g. `DateTime.Today`). While in .NET this is the machine time zone where .NET is running, the corresponding PostgreSQL translations use the [`TimeZone`](https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-TIMEZONE) connection parameter as the local time zone.
+>
+> Many of the below DateTime translations are also supported on `DateTimeOffset`.
+>
+> See also Npgsql's [NodaTime support](/efcore/mapping/nodatime.html), which is a better and safer way of interacting with date/time data.
+
+Starting with version 11.0, `EF.Functions.DateTrunc()` supports `DateTime`, `DateTimeOffset` and `TimeSpan`. The optional time zone argument is only supported for values mapped to `timestamp with time zone`; when omitted for such values, PostgreSQL uses the session time zone.
+
+.NET | SQL | Notes
+----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------
+DateTime.UtcNow (6.0+) | [now()](https://www.postgresql.org/docs/current/functions-datetime.html) |
+DateTime.Now (6.0+) | [now()::timestamp](https://www.postgresql.org/docs/current/functions-datetime.html) |
+DateTime.Today (6.0+) | [date_trunc('day', now()::timestamp)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+DateTime.UtcNow (legacy) | [now() AT TIME ZONE 'UTC'](https://www.postgresql.org/docs/current/functions-datetime.html) |
+DateTime.Now (legacy) | [now()](https://www.postgresql.org/docs/current/functions-datetime.html) |
+DateTime.Today (legacy) | [date_trunc('day', now())](https://www.postgresql.org/docs/current/functions-datetime.html) |
+EF.Functions.DateTrunc("month", value) | [date_trunc('month', value)](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 11.0
+EF.Functions.DateTrunc("month", utcDateTime, "Europe/Berlin") | [date_trunc('month', utcDateTime, 'Europe/Berlin')](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 11.0; timestamp with time zone only
+dateTime.AddDays(1) | [dateTime + INTERVAL '1 days'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+dateTime.AddHours(value) | [dateTime + INTERVAL '1 hours'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+dateTime.AddMilliseconds(value) (also DateTimeOffset) | [dateTime + value * INTERVAL '1 milliseconds'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) | Added in 11.0
+dateTime.AddMicroseconds(value) (also DateTimeOffset) | [dateTime + value * INTERVAL '1 microseconds'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) | Added in 11.0
+dateTime.AddMinutes(1) | [dateTime + INTERVAL '1 minutes'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+dateTime.AddMonths(1) | [dateTime + INTERVAL '1 months'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+dateTime.AddSeconds(1) | [dateTime + INTERVAL '1 seconds'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+dateTime.AddYears(1) | [dateTime + INTERVAL '1 years'](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+dateTime.Date | [date_trunc('day', dateTime)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.Day | [date_part('day', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.DayOfWeek | [floor(date_part('dow', dateTime))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.DayOfYear | [date_part('doy', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.Hour | [date_part('hour', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.Millisecond (also DateTimeOffset, TimeOnly) | [floor(date_part('milliseconds', dateTime))::INT % 1000](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 11.0
+dateTime.Microsecond (also DateTimeOffset, TimeOnly) | [date_part('microseconds', dateTime)::INT % 1000](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 11.0
+dateTime.Minute | [date_part('minute', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.Month | [date_part('month', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.Second | [date_part('second', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.Year | [date_part('year', dateTime)::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime.ToUniversalTime | [dateTime::timestamptz](https://www.postgresql.org/docs/current/datatype-datetime.html#id-1.5.7.13.18.7) |
+dateTime.ToLocalTime | [dateTime::timestamp](https://www.postgresql.org/docs/current/datatype-datetime.html#id-1.5.7.13.18.7) |
+dateOnly.DayNumber | [dateOnly - DATE '0001-01-01'](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 9.0
+DateOnly.FromDayNumber(x) | [DATE '0001-01-01' + x](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 9.0
+dateOnly1.DayNumber - dateOnly2.DayNumber | [dateOnly1 - dateOnly2](https://www.postgresql.org/docs/current/functions-datetime.html) | Added in 9.0
+dateTimeOffset.DateTime | [dateTimeOffset AT TIME ZONE 'UTC'](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) |
+dateTimeOffset.UtcDateTime | No PG operation (.NET-side conversion from DateTimeOffset to DateTime only) |
+dateTimeOffset.LocalDateTime | [dateTimeOffset::timestamp](https://www.postgresql.org/docs/current/datatype-datetime.html#id-1.5.7.13.18.7) |
+timeSpan.Days | [floor(date_part('day', timeSpan))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.Hours | [floor(date_part('hour', timeSpan))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.Minutes | [floor(date_part('minute', timeSpan))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.Seconds | [floor(date_part('second', timeSpan))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.Milliseconds | [floor(date_part('millisecond', timeSpan))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.Milliseconds | [floor(date_part('millisecond', timeSpan))::INT](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.TotalMilliseconds | [date_part('epoch', interval) / 0.001](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.TotalSeconds | [date_part('epoch', interval)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.TotalMinutes | [date_part('epoch', interval) / 60.0](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.TotalDays | [date_part('epoch', interval) / 86400.0](https://www.postgresql.org/docs/current/functions-datetime.html) |
+timeSpan.TotalHours | [date_part('epoch', interval) / 3600.0](https://www.postgresql.org/docs/current/functions-datetime.html) |
+dateTime1 - dateTime2 | [dateTime1 - dateTime2](https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE) |
+TimeZoneInfo.ConvertTimeBySystemTimeZoneId(utcDateTime, timezone) | [utcDateTime AT TIME ZONE timezone](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) | Only for timestamptz columns
+TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dateTime, sourceTimeZoneId, destinationTimeZoneId) | [(dateTime AT TIME ZONE sourceTimeZoneId) AT TIME ZONE destinationTimeZoneId](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) | Added in 11.0. Requires timestamp without time zone input; returns timestamp without time zone (`DateTimeKind.Unspecified`), even for UTC destinations. Not supported for `DateTimeOffset`.
+TimeZoneInfo.ConvertTimeToUtc(nonUtcDateTime) | [nonUtcDateTime::timestamptz](https://www.postgresql.org/docs/current/functions-datetime.html) | Only for timestamp columns
+DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) | [utcDateTime AT TIME ZONE 'UTC'](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) | Only for timestamptz columns
+DateTime.SpecifyKind(nonUtcDateTime, DateTimeKind.Utc) | [nonUtcDateTime AT TIME ZONE 'UTC'](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT) | Only for timestamp columns
+new DateTime(year, month, day) | [make_date(year, month, day)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+new DateTime(y, m, d, h, m, s) | [make_timestamp(y, m, d, h, m, s)](https://www.postgresql.org/docs/current/functions-datetime.html) |
+new DateTime(y, m, d, h, m, s, kind) | [make_timestamp or make_timestamptz](https://www.postgresql.org/docs/current/functions-datetime.html), based on `kind` |
+EF.Functions.Sum(timespans) | [sum(timespans)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](#aggregate-functions).
+EF.Functions.Average(timespans) | [avg(timespans)](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE) | See [Aggregate functions](#aggregate-functions).
+
+## JSON functions
+
+See [JSON mapping](json.md) for mapping options and [PostgreSQL's JSON functions and operators](https://www.postgresql.org/docs/current/functions-json.html) for operator semantics. JSON aggregate functions are listed under [Aggregate functions](#aggregate-functions).
+
+.NET | SQL | Notes
+----------------------------------------------- | ------------------------------------ | -----
+EF.Functions.JsonContains(json, contained) | json @> contained | jsonb only
+EF.Functions.JsonContained(contained, json) | contained <@ json | jsonb only
+EF.Functions.JsonExists(json, key) | json ? key | jsonb only
+EF.Functions.JsonExistAny(json, key1, key2) | json ?\| ARRAY[key1, key2] | jsonb only
+EF.Functions.JsonExistAll(json, key1, key2) | json ?& ARRAY[key1, key2] | jsonb only
+EF.Functions.JsonTypeof(json) | jsonb_typeof(json) or json_typeof(json) | Selected according to the mapped column type
+EF.Functions.JsonPathExists(json, "$.Age") | JSON_EXISTS(json, '$.Age') | Added in 11.0; requires PostgreSQL 17 or above
+
+## Hstore translations
+
+The following operations are supported for `Dictionary` and `ImmutableDictionary` mapped to PostgreSQL [`hstore`](https://www.postgresql.org/docs/current/hstore.html). Operations shown with `immutableDictionary` apply only to `ImmutableDictionary`.
+
+| .NET | SQL | Notes |
+| ---- | --- | ----- |
+| dictionary[key] | dictionary -> key | Added in 11.0 |
+| dictionary.GetValueOrDefault(key) | dictionary -> key | Added in 11.0 |
+| dictionary.GetValueOrDefault(key, fallback) | CASE WHEN dictionary ? key THEN dictionary -> key ELSE fallback END | Added in 11.0 |
+| dictionary.ContainsKey(key) | dictionary ? key | Added in 11.0 |
+| dictionary.ContainsValue(value) | array_position(avals(dictionary), value) IS NOT NULL | Added in 11.0 |
+| dictionary.Count | cardinality(akeys(dictionary)) | Added in 11.0 |
+| immutableDictionary.IsEmpty | cardinality(akeys(immutableDictionary)) = 0 | Added in 11.0 |
+| immutableDictionary.Remove(key) | immutableDictionary - key | Added in 11.0 |
+| immutableDictionary.RemoveRange(keys) | immutableDictionary - keys | Added in 11.0 |
+| immutableDictionary.SetItems(otherDictionary) | immutableDictionary \|\| otherDictionary | Added in 11.0 |
+| keys.All(key => dictionary.ContainsKey(key)) | dictionary ?& keys | Added in 11.0 |
+| keys.Any(key => dictionary.ContainsKey(key)) | dictionary ?\| keys | Added in 11.0 |
+
+Lookups return SQL `NULL` for missing keys, stored NULL values and NULL hstores, rather than throwing for a missing key. The explicit `GetValueOrDefault` fallback distinguishes a missing key from a key whose stored value is NULL. Key existence and counts include stored-NULL entries, and `ContainsValue(null)` finds stored NULL values.
+
+`SetItems` accepts another hstore-mapped mutable or immutable dictionary, not arbitrary sequences of key/value pairs.
+
+## Miscellaneous functions
+
+.NET | SQL | Notes
+---------------------------------------- | -------------------- | -----
+collection.Contains(item) | item IN collection
+enumValue.HasFlag(flag) | enumValue & flag = flag
+Guid.CreateVersion7() | [uuidv7()](https://www.postgresql.org/docs/current/functions-uuid.html) (added in 10 when targeting PG18, client-evaluated otherwise)
+Guid.NewGuid() | [gen_random_uuid()](https://www.postgresql.org/docs/current/functions-uuid.html), or [uuid_generate_v4()](https://www.postgresql.org/docs/current/uuid-ossp.html) from [`uuid-ossp`](https://www.postgresql.org/docs/current/uuid-ossp.html) when targeting pre-PG13
+nullable.GetValueOrDefault() | coalesce(nullable, 0)
+nullable.GetValueOrDefault(defaultValue) | coalesce(nullable, defaultValue)
+bool.Parse(stringValue) | CAST(stringValue AS boolean) | Added in 11.0
+byte.Parse(stringValue) | CAST(stringValue AS smallint) | Added in 11.0
+short.Parse(stringValue) | CAST(stringValue AS smallint) | Added in 11.0
+int.Parse(stringValue) | CAST(stringValue AS integer) | Added in 11.0
+long.Parse(stringValue) | CAST(stringValue AS bigint) | Added in 11.0
+float.Parse(stringValue) | CAST(stringValue AS real) | Added in 11.0
+double.Parse(stringValue) | CAST(stringValue AS double precision) | Added in 11.0
+decimal.Parse(stringValue) | CAST(stringValue AS numeric) | Added in 11.0
+
+## Binary functions
+
+.NET | SQL | Notes
+---------------------------- | ------------------------------- | --------
+bytes[i] | get_byte(bytes, i) |
+bytes.Contains(value) | position(value IN bytes) > 0 |
+bytes.Any() | length(bytes) > 0 | Added in 11.0
+bytes.Concat(bytes2) | bytes \|\| bytes2 | Added in 11.0
+bytes.Length | length(@bytes) |
+bytes1.SequenceEqual(bytes2) | @bytes = @second |
+bitArray.Get(index) | get_bit(bitArray, index) = 1 | Added in 11.0
+bitArray[index] | get_bit(bitArray, index) = 1 | Added in 11.0
+
+## Math functions
+
+.NET | SQL | Notes
+----------------------- | ------------------ | -----
+Math.Abs(value) | abs(value) |
+Math.Acos(d) | acos(d) |
+Math.Asin(d) | asin(d) |
+Math.Atan(d) | atan(d) |
+Math.Atan2(y, x) | atan2(y, x) |
+Math.Ceiling(d) | ceiling(d) |
+Math.Cos(d) | cos(d) |
+Math.Exp(d) | exp(d) |
+Math.Floor(d) | floor(d) |
+Math.Log(d) | ln(d) |
+Math.Log10(d) | log(d) |
+Math.Max(x, y) | greatest(x, y) |
+Math.Min(x, y) | least(x, y) |
+Math.Pow(x, y) | power(x, y) |
+Math.Round(d) | round(d) |
+Math.Round(d, decimals) | round(d, decimals) |
+Math.Sin(a) | sin(a) |
+Math.Sign(value) | sign(value)::int |
+Math.Sqrt(d) | sqrt(d) |
+Math.Tan(a) | tan(a) |
+Math.Truncate(d) | trunc(d) |
+EF.Functions.Random() | random() |
+
+See also [Aggregate statistics functions](#aggregate-functions).
+
+## Row value comparisons
+
+The following allow expressing [comparisons over SQL row values](https://www.postgresql.org/docs/current/functions-comparisons.html#ROW-WISE-COMPARISON). This are particularly useful for implementing efficient pagination, see [the EF Core docs](https://docs.microsoft.com/ef/core/querying/pagination) for more information.
+
+.NET | SQL
+--------------------------------------------------------------------------------- | ----------------
+EF.Functions.GreaterThan(ValueTuple.Create(a, b), ValueTuple.Create(c, d)) | (a, b) > (c, d)
+EF.Functions.LessThan(ValueTuple.Create(a, b), ValueTuple.Create(c, d)) | (a, b) < (c, d)
+EF.Functions.GreaterThanOrEqual(ValueTuple.Create(a, b), ValueTuple.Create(c, d)) | (a, b) >= (c, d)
+EF.Functions.LessThanOrEqual(ValueTuple.Create(a, b), ValueTuple.Create(c, d)) | (a, b) <= (c, d)
+ValueTuple.Create(a, b).Equals(ValueTuple.Create(c, d)) | (a, b) = (c, d)
+!ValueTuple.Create(a, b).Equals(ValueTuple.Create(c, d)) | (a, b) <> (c, d)
+
+## Network functions
+
+.NET | SQL
+------------------------------------------------ | ---
+IPAddress.Parse(string) | [CAST(string AS inet)](https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-INET)
+PhysicalAddress.Parse(string) | [CAST(string AS macaddr)](https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-MACADDR)
+EF.Functions.LessThan(net1, net2) | [net1 < net2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.LessThanOrEqual(net1, net2) | [net1 <= net2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.GreaterThan(net1, net2) | [net1 > net2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.GreaterThanOrEqual(net1, net2) | [net1 >= net2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.ContainedBy(inet1, inet2) | [inet1 << inet2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.ContainedByOrEqual(inet1, inet2) | [inet1 <<= inet2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.Contains(inet1, inet2) | [inet1 >> inet2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.ContainsOrEqual(inet1, inet2) | [inet1 >>= inet2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.ContainsOrContainedBy(inet1, inet2) | [inet1 && inet2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.BitwiseNot(net) | [~net1](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.BitwiseAnd(net1, net2) | [net1 & net2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.BitwiseOr(net1, net2) | [net1 \| net2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.Add(inet, int) | [inet + int](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.Subtract(inet, int) | [inet - int](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.Subtract(inet1, inet2) | [inet1 - inet2](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-OPERATORS-TABLE)
+EF.Functions.Abbreviate(inet) | [abbrev(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Abbreviate(cidr) | [abbrev(cidr)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Broadcast(inet) | [broadcast(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Family(inet) | [family(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Host(inet) | [host(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.HostMark(inet) | [hostmask(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.MaskLength(inet) | [masklen(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Netmask(inet) | [netmask(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Network(inet) | [network(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.SetMaskLength(inet) | [set_masklen(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.SetMaskLength(cidr) | [set_masklen(cidr)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Text(inet) | [text(inet)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.SameFamily(inet1, inet2) | [inet_same_family(inet1, inet2)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Merge(inet1, inet2) | [inet_merge(inet1, inet2)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Truncate(macaddr) | [trunc(macaddr)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+EF.Functions.Set7BitMac8(macaddr8) | [macaddr8_set7bit(macaddr8)](https://www.postgresql.org/docs/current/functions-net.html#CIDR-INET-FUNCTIONS-TABLE)
+
+## Trigram functions
+
+The below translations provide functionality for determining the similarity of alphanumeric text based on trigram matching, using the [`pg_trgm`](https://www.postgresql.org/docs/current/pgtrgm.html) extension which is bundled with standard PostgreSQL distributions. All the below parameters are strings.
+
+.NET | SQL
+----------------------------------------------------------------- | --------------------
+EF.Functions.TrigramsShow(s) | show_trgm(s)
+EF.Functions.TrigramsSimilarity(s1, s2) | similarity(s1, s2)
+EF.Functions.TrigramsWordSimilarity(s1, s2) | word_similarity(s1, s2)
+EF.Functions.TrigramsStrictWordSimilarity(s1, s2) | strict_word_similarity(s1, s2)
+EF.Functions.TrigramsAreSimilar(s1, s2) | s1 % s2
+EF.Functions.TrigramsAreWordSimilar(s1, s2) | s1 <% s2
+EF.Functions.TrigramsAreNotWordSimilar(s1, s2) | s1 %> s2
+EF.Functions.TrigramsAreStrictWordSimilar(s1, s2) | s1 <<% s2
+EF.Functions.TrigramsAreNotStrictWordSimilar(s1, s2) | s1 %>> s2
+EF.Functions.TrigramsSimilarityDistance(s1, s2) | s1 <-> s2
+EF.Functions.TrigramsWordSimilarityDistance(s1, s2) | s1 <<-> s2
+EF.Functions.TrigramsWordSimilarityDistanceInverted(s1, s2) | s1 <->> s2
+EF.Functions.TrigramsStrictWordSimilarityDistance(s1, s2) | s1 <<<-> s2
+EF.Functions.TrigramsStrictWordSimilarityDistanceInverted(s1, s2) | s1 <->>> s2
+
+## Fuzzy string match functions
+
+The below translations provide functionality for determining similarities and distance between strings, using the [`fuzzystrmatch`](https://www.postgresql.org/docs/current/fuzzystrmatch.html) extension which is bundled with standard PostgreSQL distributions.
+
+.NET | SQL | Notes
+------------------------------------------------------------------------------------------------------ | -------------------- | -----
+EF.Functions.FuzzyStringMatchSoundex(text) | [soundex(text)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-SOUNDEX)
+EF.Functions.FuzzyStringMatchDifference(source, target) | [difference(source, target)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-SOUNDEX)
+EF.Functions.FuzzyStringMatchDaitchMokotoff(text) | [daitch_mokotoff(text)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-DAITCH-MOKOTOFF) | Added in 11.0. Requires PostgreSQL 16+
+EF.Functions.FuzzyStringMatchLevenshtein(source, target) | [levenshtein(source, target)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-LEVENSHTEIN)
+EF.Functions.FuzzyStringMatchLevenshtein(source, target, ins_cost, del_cost, sub_cost) | [levenshtein(source, target, ins_cost, del_cost, sub_cost)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-LEVENSHTEIN)
+EF.Functions.FuzzyStringMatchLevenshteinLessEqual(source, target, max_d) | [levenshtein(source, target, max_d)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-LEVENSHTEIN)
+EF.Functions.FuzzyStringMatchLevenshteinLessEqual(source, target, ins_cost, del_cost, sub_cost, max_d) | [levenshtein(source, target, ins_cost, del_cost, sub_cost, max_d)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-LEVENSHTEIN)
+EF.Functions.FuzzyStringMatchMetaphone(text, max_output_length) | [metaphone(text, max_output_length)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-METAPHONE)
+EF.Functions.FuzzyStringMatchDoubleMetaphone(text) | [dmetaphone(text)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-METAPHONE)
+EF.Functions.FuzzyStringMatchDoubleMetaphoneAlt(text) | [dmetaphone_alt(text)](https://www.postgresql.org/docs/current/fuzzystrmatch.html#FUZZYSTRMATCH-METAPHONE)
+
+`FuzzyStringMatchDaitchMokotoff` returns `string[]?`, with `null` possible for inputs without encodable characters, including empty strings. Projection and array indexing are supported, but composing `Contains`, `Any`, `Intersect(...).Any()`, or `.Length` on the result is not currently translated ([dotnet/efcore#35980](https://github.com/dotnet/efcore/issues/35980)).
+
+## LTree functions
+
+The below translations are for working with label trees from the PostgreSQL [`ltree`](https://www.postgresql.org/docs/current/ltree.html) extension. Use the type to represent ltree and invoke methods on it in EF Core LINQ queries.
+
+.NET | SQL
+----------------------------------------------------------------- | --------------------
+ltree1.IsAncestorOf(ltree2) | ltree1 @> ltree2
+ltree1.IsDescendantOf(ltree2) | ltree1 <@ ltree2
+ltree.MatchesLQuery(lquery) | ltree ~ lquery
+ltree.MatchesLTxtQuery(ltxtquery) | ltree @ ltxtquery
+lqueries.Any(q => ltree.MatchesLQuery(q)) | ltree ? lqueries
+ltrees.Any(t => t.IsAncestorOf(ltree)) | ltrees @> ltree
+ltrees.Any(t => t.IsDescendantOf(ltree)) | ltrees <@ ltree
+ltrees.Any(t => t.MatchesLQuery(lquery)) | ltrees ~ ltree
+ltrees.Any(t => t.MatchesLTxtQuery(ltxtquery)) | ltrees @ ltxtquery
+ltrees.Any(t => lqueries.Any(q => t.MatchesLQuery(q))) | ltrees ? lqueries
+ltrees.FirstOrDefault(l => l.IsAncestorOf(ltree)) | ltrees ?@> ltree
+ltrees.FirstOrDefault(l => l.IsDescendantOf(ltree)) | ltrees ?<@ ltree
+ltrees.FirstOrDefault(l => l.MatchesLQuery(lquery)) | ltrees ?~ ltree
+ltrees.FirstOrDefault(l => l.MatchesLTxtQuery(ltxtquery)) | ltrees ?@ ltree
+ltree.Subtree(0, 1) | subltree(ltree, 0, 1)
+ltree.Subpath(0, 1) | sublpath(ltree, 0, 1)
+ltree.Subpath(2) | sublpath(ltree, 2)
+ltree.NLevel | nlevel(ltree)
+ltree.Index(subpath) | index(ltree, subpath)
+ltree.Index(subpath, 2) | index(ltree, subpath, 2)
+LTree.LongestCommonAncestor(ltree1, ltree2) | lca(index(ltree1, ltree2)
+
+## Cube functions
+
+The below translations are for working with cubes from the PostgreSQL [`cube`](https://www.postgresql.org/docs/current/cube.html) extension. Use the type to represent cube and invoke methods on it in EF Core LINQ queries.
+
+.NET | SQL
+----------------------------------- | --------------------
+cube1.Overlaps(cube2) | [cube1 && cube2](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube1.Contains(cube2) | [cube1 @> cube2](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube1.ContainedBy(cube2) | [cube1 <@ cube2](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube.NthCoordinate(n) | [cube -> n + 1](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube.NthCoordinateKnn(n) | [cube ~> n + 1](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube1.Distance(cube2) | [cube1 <-> cube2](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube1.DistanceTaxicab(cube2) | [cube1 <#> cube2](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube1.DistanceChebyshev(cube2) | [cube1 <=> cube2](https://www.postgresql.org/docs/current/cube.html#CUBE-OPERATORS-TABLE)
+cube1.Union(cube2) | [cube_union(cube1, cube2)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube1.Intersect(cube2) | [cube_inter(cube1, cube2)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube.Enlarge(r, n) | [cube_enlarge(cube, r, n)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube.Dimensions | [cube_dim(cube)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube.IsPoint | [cube_is_point(cube)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube.ToSubset(indexes) | [cube_subset(cube, indexes + 1)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube.LowerLeft[n] | [cube_ll_coord(cube, n + 1)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+cube.UpperRight[n] | [cube_ur_coord(cube, n + 1)](https://www.postgresql.org/docs/current/cube.html#CUBE-FUNCTIONS-TABLE)
+
+## Aggregate functions
+
+The PostgreSQL aggregate functions are documented [here](https://www.postgresql.org/docs/current/functions-aggregate.html).
+
+| .NET | SQL
+| ---------------------------------------------------------------------------------- | --------------------
+| string.Join(", ", agg_strings) | string_agg(agg_strings, ', ')
+| EF.Functions.ArrayAgg(values) | array_agg(values)
+| EF.Functions.JsonbAgg(values) | jsonb_agg(values)
+| EF.Functions.JsonAgg(values) | json_agg(values)
+| EF.Functions.Sum(timespans) | sum(timespans)
+| EF.Functions.Average(timespans) | avg(timespans)
+| EF.Functions.JsonObjectAgg(tuple_of_2) | json_object_agg(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.JsonbObjectAgg(tuple_of_2) | jsonb_object_agg(tuple_of_2.first, tuple_of_2.second)
+| ranges.RangeAgg() | range_agg(ranges)
+| ranges.RangeIntersectAgg() | range_intersect_agg(ranges)
+| multiranges.RangeIntersectAgg() | range_intersect_agg(multiranges)
+| |
+| EF.Functions.StandardDeviationSample(values) | stddev_samp(values)
+| EF.Functions.StandardDeviationPopulation(values) | stddev_pop(values)
+| EF.Functions.VarianceSample(values) | var_samp(values)
+| EF.Functions.VariancePopulation(values) | var_pop(values)
+| |
+| EF.Functions.Correlation(tuple) | corr(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.CovariancePopulation(tuple) | covar_pop(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.CovarianceSample(tuple) | covar_samp(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrAverageX(tuple) | regr_avgx(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrAverageY(tuple) | regr_avgy(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrCount(tuple) | regr_count(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrIntercept(tuple) | regr_intercept(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrR2(tuple) | regr_r2(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrSlope(tuple) | regr_slope(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrSXX(tuple) | regr_sxx(tuple_of_2.first, tuple_of_2.second)
+| EF.Functions.RegrSXY(tuple) | regr_sxy(tuple_of_2.first, tuple_of_2.second)
+
+Aggregate functions can be used as follows:
+
+```csharp
+var query = ctx.Set()
+ .GroupBy(c => c.City)
+ .Select(
+ g => new
+ {
+ City = g.Key,
+ Companies = EF.Functions.ArrayAgg(g.Select(c => c.ContactName))
+ });
+```
+
+To use functions accepting a tuple_of_2, project out from the group as follows:
+
+```csharp
+var query = ctx.Set()
+ .GroupBy(c => c.City)
+ .Select(
+ g => new
+ {
+ City = g.Key,
+ Companies = EF.Functions.JsonObjectAgg(g.Select(c => ValueTuple.Create(c.CompanyName, c.ContactName)))
+ });
+```
diff --git a/docs/mapping/vector-search.md b/docs/mapping/vector-search.md
new file mode 100644
index 0000000000..7094fea72f
--- /dev/null
+++ b/docs/mapping/vector-search.md
@@ -0,0 +1,91 @@
+# Vector Search
+
+Vector search finds items whose vectors are close to a query vector. For example, an embedding model can represent text or images as vectors, allowing a search to find semantically similar items rather than just matching keywords. The query vector and stored vectors must be produced by the same embedding model.
+
+PostgreSQL supports vector search through the [pgvector extension](https://github.com/pgvector/pgvector). The [pgvector .NET library](https://github.com/pgvector/pgvector-dotnet#entity-framework-core) provides EF Core integration, including vector types and distance functions.
+
+## Setup
+
+Install the [Pgvector.EntityFrameworkCore](https://www.nuget.org/packages/Pgvector.EntityFrameworkCore) package. Version 0.3.0 supports EF Core 9, 10 and 11. For EF Core 8, use version 0.2.2 and its [setup instructions](https://github.com/pgvector/pgvector-dotnet/blob/efcore-v0.2.2/README.md#entity-framework-core); the setup below is for version 0.3.0.
+
+Configure the plugin when configuring your context:
+
+```csharp
+using Microsoft.EntityFrameworkCore;
+using Pgvector.EntityFrameworkCore;
+
+optionsBuilder.UseNpgsql("", o => o.UseVector());
+```
+
+If you use an [external NpgsqlDataSource](../index.md#using-an-external-npgsqldatasource), configure vector support on the data source as well:
+
+```csharp
+using Npgsql;
+
+var dataSourceBuilder = new NpgsqlDataSourceBuilder("");
+dataSourceBuilder.UseVector();
+var dataSource = dataSourceBuilder.Build();
+
+optionsBuilder.UseNpgsql(dataSource, o => o.UseVector());
+```
+
+Install the pgvector extension on your PostgreSQL server. To have EF migrations enable it in your database, add the following to your context:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.HasPostgresExtension("vector");
+}
+```
+
+## Model and query
+
+Define a vector property with the number of dimensions used by your embedding model:
+
+```csharp
+using System.ComponentModel.DataAnnotations.Schema;
+using Pgvector;
+
+public class Item
+{
+ public int Id { get; set; }
+ public string Name { get; set; } = null!;
+
+ [Column(TypeName = "vector(3)")]
+ public Vector? Embedding { get; set; }
+}
+```
+
+The following query orders items by Euclidean (L2) distance to a query embedding and returns the five closest. The three-dimensional vector is only an example; use an embedding generated by your model in a real application.
+
+```csharp
+using Pgvector.EntityFrameworkCore;
+
+var embedding = new Vector(new float[] { 1, 1, 1 });
+var items = await context.Set- ()
+ .OrderBy(i => i.Embedding!.L2Distance(embedding))
+ .Take(5)
+ .Select(i => new { i.Id, i.Name })
+ .ToListAsync();
+```
+
+The distance is computed in PostgreSQL; the projection avoids retrieving the stored vectors. pgvector also supports other distance metrics and approximate nearest-neighbor indexes; see the [pgvector documentation](https://github.com/pgvector/pgvector) and [EF Core examples](https://github.com/pgvector/pgvector-dotnet#entity-framework-core).
+
+> [!WARNING]
+> By default, EF loads vector properties when materializing entities, even if you only need the other properties. Embeddings can be large, so this can unnecessarily transfer and allocate substantial amounts of data. Disable automatic loading as shown [below](#avoiding-loading-vectors), or project only the properties you need.
+
+## Avoiding loading vectors
+
+Starting with EF Core 11, you can disable automatic loading of a vector property when entities are queried:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.HasPostgresExtension("vector");
+ modelBuilder.Entity
- ().Property(i => i.Embedding).Metadata.IsAutoLoaded = false;
+}
+```
+
+The property can still be used in server-side queries, such as the distance calculation above. It is not populated on materialized entities, and an unloaded property is excluded from updates unless modified. To retrieve a vector, project it separately, for example `Select(i => new { i.Id, i.Embedding })`. Selecting it alongside an entity does not populate that entity's property, nor does returning its column from `FromSql` ([EF Core issue](https://github.com/dotnet/efcore/issues/39398)).
+
+In EF Core 8, 9 and 10, `IsAutoLoaded` is not available. Instead, use projections like the example above to retrieve only the properties you need; queries that materialize an entity still load its vector property.
diff --git a/docs/misc/collations-and-case-sensitivity.md b/docs/misc/collations-and-case-sensitivity.md
new file mode 100644
index 0000000000..dfc4508e5a
--- /dev/null
+++ b/docs/misc/collations-and-case-sensitivity.md
@@ -0,0 +1,108 @@
+# Collations and Case Sensitivity
+
+> It's recommended that you start by reading [the general Entity Framework Core docs on collations and case sensitivity](https://docs.microsoft.com/ef/core/miscellaneous/collations-and-case-sensitivity).
+
+PostgreSQL is a case-sensitive database by default, but provides various possibilities for performing case-insensitive operations and working with collations. Depending on your PostgreSQL version, full collation support may be somewhat incomplete, so you may need to carefully review your options below and pick the one which suits you.
+
+## PostgreSQL collations
+
+PostgreSQL has full support for managing collations, and this is the recommended way for managing textual comparisons and sorting. However, note that ; support for non-deterministic collations - coverting case-insensitivity - was relatively limited in some ways. While recent versions such as PostgreSQL 18 support case-insensitive collations quite well, previous versions did not (for example, it was not possible perform pattern matching via LIKE on columns with a non-deterministic collation). Read more about PostgreSQL collation support [in the documentation](https://www.postgresql.org/docs/current/collation.html).
+
+### Creating a collation
+
+In PostgreSQL, collations are first-class, named database objects which can be created and dropped, just like tables. To create a collation, place the following in your context's `OnModelCreating`:
+
+```csharp
+modelBuilder.HasCollation("my_collation", locale: "en-u-ks-primary", provider: "icu", deterministic: false);
+```
+
+This creates a collation with the name `my_collation`: this is an arbitrary name you can choose, which you will be specifying later when assigning the collation to columns. The rest of the parameters instruct PostgreSQL to create a non-deterministic, case-insensitive ICU collation. ICU collations are very powerful, and allow you to specify precise rules with regards to case, accents and other textual aspects. Consult [the ICU docs](https://unicode-org.github.io/icu/userguide/collation/) for more information on supported features and keywords.
+
+### Column collation
+
+Once a collation has been created in your database, you can specify it on columns:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.HasCollation("my_collation", locale: "en-u-ks-primary", provider: "icu", deterministic: false);
+
+ modelBuilder.Entity().Property(c => c.Name)
+ .UseCollation("my_collation");
+}
+```
+
+This will cause all textual operators on this column to be case-insensitive.
+
+### Database collation
+
+PostgreSQL also allows you to specify collations at the database level, when it is created:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.UseCollation("");
+}
+```
+
+Unfortunately, the database collation is quite limited in PostgreSQL; it notably does not support non-deterministic collations (e.g. case-insensitive ones). To work around this limitation, you can use EF Core's [pre-convention model configuration](https://docs.microsoft.com/ef/core/modeling/bulk-configuration#pre-convention-configuration) feature:
+
+```csharp
+protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
+{
+ configurationBuilder.Properties().UseCollation("my_collation");
+}
+```
+
+All columns created with this configuration will automatically have their collation specified accordingly, and all existing columns will be altered. The end result of the above is very similar to specifying a database collation: instead of telling PostgreSQL to implicit apply a collation to all columns, EF Core will do the same for you in its migrations.
+
+## The citext type
+
+The older PostgreSQL method for performing case-insensitive text operations is the `citext` type; it is similar to the `text` type, but operators are functions between `citext` values are implicitly case-insensitive. Use this type only if case-insensitive collations (see above) are insufficient for your purposes. [The PostgreSQL docs](https://www.postgresql.org/docs/current/citext.html) provide more information on this type.
+
+`citext` is available in a PostgreSQL-bundled extension, so you'll first have to install it:
+
+```csharp
+modelBuilder.HasPostgresExtension("citext");
+```
+
+Specifying that a column should use `citext` is simply a matter of setting the column's type:
+
+### [Data Annotations](#tab/data-annotations)
+
+```csharp
+public class Blog
+{
+ public int Id { get; set; }
+ [Column(TypeName = "citext")]
+ public string Name { get; set; }
+}
+```
+
+### [Fluent API](#tab/fluent-api)
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity().Property(b => b.Name)
+ .HasColumnType("citext");
+}
+```
+
+***
+
+Some limitations (others are listed in [the PostgreSQL docs](https://www.postgresql.org/docs/current/citext.html)):
+
+* While `citext` allows case-insensitive comparisons, it doesn't handle other aspects of collations, such as accents.
+* Several PostgreSQL text functions are overloaded to work with `citext` as expected, but others aren't. Using a function that isn't overloaded will result in a regular, case-sensitive match.
+* Unlike collations, `citext` does not allow the same column to be compared case-sensitively in some queries, and and insensitively in others.
+
+## ILIKE
+
+`ILIKE` is a PostgreSQL-specific operator that works just like `LIKE`, but is case-insensitive. If you only need to perform case-insensitive `LIKE` pattern matching, then this could be sufficient. The provider exposes this via `EF.Functions.ILike`:
+
+```csharp
+var results = ctx.Blogs
+ .Where(b => EF.Functions.ILike(b.Name, "a%b"))
+ .ToList();
+```
diff --git a/docs/misc/database-creation.md b/docs/misc/database-creation.md
new file mode 100644
index 0000000000..8e5f9a6a8a
--- /dev/null
+++ b/docs/misc/database-creation.md
@@ -0,0 +1,36 @@
+# Database Creation
+
+## Specifying the administrative db
+
+When the Npgsql EF Core provider creates or deletes a database (`EnsureCreated()`, `EnsureDeleted()`), it must connect to an administrative database which already exists (with PostgreSQL you always have to be connected to some database, even when creating/deleting another database). Up to now the `postgres` database was used, which is supposed to always be present.
+
+However, there are some PostgreSQL-like databases where the `postgres` database is not available. For these cases you can specify the administrative database as follows:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql(
+ "",
+ options => options.UseAdminDatabase("my_admin_db"));
+```
+
+## Using a database template
+
+When creating a new database,
+[PostgreSQL allows specifying another "template database"](http://www.postgresql.org/docs/current/static/manage-ag-templatedbs.html)
+which will be copied as the basis for the new one. This can be useful for including database entities which are not managed by Entity Framework Core. You can trigger this by using `HasDatabaseTemplate` in your context's `OnModelCreating`:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.UseDatabaseTemplate("my_template_db");
+```
+
+## Setting a tablespace
+
+PostgreSQL allows you to locate your database in different parts of your filesystem, [via tablespaces](https://www.postgresql.org/docs/current/static/manage-ag-tablespaces.html). The Npgsql EF Core provider allows you to specify your database's namespace:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.UseTablespace("my_tablespace");
+```
+
+You must have created your tablespace prior to this via the `CREATE TABLESPACE` command - the Npgsql EF Core provider does not do this for you. Note also that specifying a tablespace on specific tables is not supported.
diff --git a/docs/misc/other.md b/docs/misc/other.md
new file mode 100644
index 0000000000..e51fcb8dbe
--- /dev/null
+++ b/docs/misc/other.md
@@ -0,0 +1,58 @@
+# Other
+
+## PostgreSQL extensions
+
+The Npgsql EF Core provider allows you to specify PostgreSQL extensions that should be set up in your database.
+Simply use `HasPostgresExtension` in your context's `OnModelCreating` method:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.HasPostgresExtension("hstore");
+```
+
+## Execution Strategy
+
+The Npgsql EF Core provider provides a retrying execution strategy, which will attempt to detect most transient PostgreSQL/network errors and will automatically retry your operation. To enable, place the following code in your context's `OnModelConfiguring`:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql(
+ "",
+ options => options.EnableRetryOnFailure());
+```
+
+This strategy relies on the `IsTransient` property of `NpgsqlException`.
+
+## Certificate authentication
+
+The Npgsql allows you to provide a callback for verifying the server-provided certificates, and to provide a callback for providing certificates to the server. The latter, if properly set up on the PostgreSQL side, allows you to do client certificate authentication - see [the Npgsql docs](http://www.npgsql.org/doc/security.html#encryption-ssltls) and also [the PostgreSQL docs](https://www.postgresql.org/docs/current/static/ssl-tcp.html#SSL-CLIENT-CERTIFICATES) on setting this up.
+
+The Npgsql EF Core provider allows you to set these two callbacks on the `DbContextOptionsBuilder` as follows:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql(
+ "",
+ options =>
+ {
+ options.RemoteCertificateValidationCallback(MyCallback1);
+ options.ProvideClientCertificatesCallback(MyCallback2);
+ });
+```
+
+You may also consider passing `Trust Server Certificate=true` in your connection string to make Npgsql accept whatever certificate your PostgreSQL provides (useful for self-signed certificates).
+
+> [!CAUTION]
+> When specifying the options via `OnConfiguring`, make sure that the callbacks you pass in are static methods. Passing in instance methods causes EF Core to create a new service provider for each context instance, which can degrade performance in a significant way.
+
+## CockroachDB Interleave In Parent
+
+If you're using CockroachDB, the Npgsql EF Core provider exposes its ["interleave in parent" feature](https://www.cockroachlabs.com/docs/stable/interleave-in-parent.html). Use the following code:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .UseCockroachDbInterleaveInParent(
+ typeof(ParentEntityType),
+ new List { "prefix_column_1", "prefix_column_2" });
+```
diff --git a/docs/misc/temporal-constraints.md b/docs/misc/temporal-constraints.md
new file mode 100644
index 0000000000..950961ebac
--- /dev/null
+++ b/docs/misc/temporal-constraints.md
@@ -0,0 +1,177 @@
+# Temporal constraints
+
+> [!NOTE]
+> Temporal constraints are only supported starting with version 11 of the EF provider, and require PostgreSQL 18.
+
+PostgreSQL 18 introduced temporal constraints, which allow you to enforce data integrity rules over time periods. These features are particularly valuable for applications that need to track the validity periods of data, such as employee records, pricing information, equipment assignments, or any scenario where you need to maintain a complete historical timeline without gaps or overlaps.
+
+Temporal constraints work with PostgreSQL's range types, such as `daterange`, `tstzrange` (timestamp with timezone range), and `tsrange` (timestamp range).
+
+## WITHOUT OVERLAPS
+
+The `WITHOUT OVERLAPS` clause can be added to primary and alternate keys to ensure that for any given set of scalar column values, the associated time ranges do not overlap.
+
+A temporal key combines regular columns with a range column. This allows multiple rows for the same entity (e.g., same employee ID) as long as their time periods don't overlap, enabling you to maintain a complete history of changes:
+
+```csharp
+public class Employee
+{
+ public int EmployeeId { get; set; }
+ public string Name { get; set; }
+ public string Department { get; set; }
+ public decimal Salary { get; set; }
+ public NpgsqlRange ValidPeriod { get; set; }
+}
+
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity(b =>
+ {
+ // Configure the range property with a default value
+ b.Property(e => e.ValidPeriod)
+ .HasDefaultValueSql("tstzrange(now(), 'infinity', '[)')");
+
+ // Configure the temporal primary key
+ b.HasKey(e => new { e.EmployeeId, e.ValidPeriod })
+ .WithoutOverlaps();
+ });
+}
+```
+
+This configuration creates the following table:
+
+```sql
+CREATE TABLE employees (
+ employee_id INTEGER,
+ name VARCHAR(100) NOT NULL,
+ department VARCHAR(50) NOT NULL,
+ salary DECIMAL(10,2) NOT NULL,
+ valid_period tstzrange NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
+ PRIMARY KEY (employee_id, valid_period WITHOUT OVERLAPS)
+);
+```
+
+With this constraint, you can insert multiple records for the same employee as long as their time periods don't overlap:
+
+```sql
+-- Valid: Two records for the same employee with non-overlapping periods
+INSERT INTO employees (employee_id, name, department, salary, valid_period)
+VALUES
+ (1, 'Alice Johnson', 'Engineering', 75000, tstzrange('2024-01-01', '2025-01-01', '[)')),
+ (1, 'Alice Johnson', 'Engineering', 85000, tstzrange('2025-01-01', 'infinity', '[)'));
+
+-- Invalid: This would fail because it overlaps with existing data
+INSERT INTO employees (employee_id, name, department, salary, valid_period)
+VALUES (1, 'Alice Johnson', 'Engineering', 95000, tstzrange('2024-06-01', '2025-06-01', '[)'));
+```
+
+> [!IMPORTANT]
+> The range column with `WITHOUT OVERLAPS` must be the last column in the primary key definition.
+
+## PERIOD for temporal foreign keys
+
+PostgreSQL 18 also introduces temporal foreign keys using the `PERIOD` clause. These constraints ensure that foreign key relationships are maintained across time periods, checking for range containment rather than simple equality.
+
+A temporal foreign key ensures that the referenced row exists during the entire time period of the referencing row. This is particularly useful when you need to enforce that related temporal data is valid for the same time periods.
+
+```csharp
+public class Employee
+{
+ public int EmployeeId { get; set; }
+ public string Name { get; set; }
+ public NpgsqlRange ValidPeriod { get; set; }
+}
+
+public class ProjectAssignment
+{
+ public int AssignmentId { get; set; }
+ public int EmployeeId { get; set; }
+ public string ProjectName { get; set; }
+ public NpgsqlRange AssignmentPeriod { get; set; }
+}
+
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity(b =>
+ {
+ b.Property(e => e.ValidPeriod)
+ .HasDefaultValueSql("tstzrange(now(), 'infinity', '[)')");
+
+ b.HasKey(e => new { e.EmployeeId, e.ValidPeriod })
+ .WithoutOverlaps();
+ });
+
+ modelBuilder.Entity(b =>
+ {
+ b.HasOne()
+ .WithMany()
+ .HasForeignKey(e => new { e.EmployeeId, e.AssignmentPeriod })
+ .HasPrincipalKey(e => new { e.EmployeeId, e.ValidPeriod })
+ .WithPeriod();
+ });
+}
+```
+
+This generates a foreign key constraint like:
+
+```sql
+ALTER TABLE project_assignments
+ADD CONSTRAINT fk_emp_temporal
+FOREIGN KEY (employee_id, PERIOD assignment_period)
+REFERENCES employees (employee_id, PERIOD valid_period);
+```
+
+With this constraint:
+
+```sql
+-- Valid: Assignment period falls within the employee's validity period
+INSERT INTO project_assignments (employee_id, project_name, assignment_period)
+VALUES (1, 'Website Redesign', tstzrange('2024-03-01', '2024-06-01', '[)'));
+
+-- Invalid: Assignment period extends beyond the employee's validity period
+INSERT INTO project_assignments (employee_id, project_name, assignment_period)
+VALUES (1, 'Legacy Project', tstzrange('2022-01-01', '2022-06-01', '[)'));
+```
+
+## NodaTime ranges
+
+With the [NodaTime plugin](../mapping/nodatime.md) enabled, temporal constraints also support `Interval` (mapped to `tstzrange`) and `DateInterval` (mapped to `daterange`). For example, the employee's validity period can be declared as:
+
+```csharp
+public Interval ValidPeriod { get; set; }
+```
+
+Configure the key with `.WithoutOverlaps()` and the foreign key with `.WithPeriod()` as above; both sides of the relationship must use compatible range mappings. The range property must be last in both keys.
+
+## Querying temporal data
+
+When querying temporal data, PostgreSQL's range operators are particularly useful. The containment operator (`@>`) checks if a range contains a specific point in time:
+
+```csharp
+// Find employees who were active on a specific date
+var activeEmployees = context.Employees
+ .Where(e => e.ValidPeriod.Contains(new DateTime(2024, 6, 15)))
+ .ToList();
+
+// Find all historical records for a specific employee
+var employeeHistory = context.Employees
+ .Where(e => e.EmployeeId == 1)
+ .OrderBy(e => e.ValidPeriod)
+ .ToList();
+```
+
+These queries translate to efficient SQL that can leverage GiST indexes:
+
+```sql
+-- Active employees on a specific date
+SELECT * FROM employees
+WHERE valid_period @> '2024-06-15'::timestamptz;
+
+-- Employee history
+SELECT * FROM employees
+WHERE employee_id = 1
+ORDER BY valid_period;
+```
+
+> [!NOTE]
+> Temporal constraints require the `btree_gist` extension to be installed in your database. The EF provider automatically installs `btree_gist` when it detects a key with `WITHOUT OVERLAPS`.
diff --git a/docs/modeling/concurrency.md b/docs/modeling/concurrency.md
new file mode 100644
index 0000000000..7129f07f47
--- /dev/null
+++ b/docs/modeling/concurrency.md
@@ -0,0 +1,54 @@
+# Concurrency Tokens
+
+> [!NOTE]
+> Please read the general [Entity Framework Core docs on concurrency tokens](https://docs.microsoft.com/en-us/ef/core/modeling/concurrency).
+
+Entity Framework Core supports the concept of optimistic concurrency - a property on your entity is designated as a concurrency token, and EF Core detects concurrent modifications by checking whether that token has changed since the entity was read.
+
+## The PostgreSQL xmin system column
+
+Although applications can update concurrency tokens themselves, we frequently rely on the database automatically updating a column on update - a "last modified" timestamp, an SQL Server `rowversion`, etc. Unfortunately PostgreSQL doesn't have such auto-updating columns - but there is one feature that can be used for concurrency token. All PostgreSQL tables have a set of [implicit and hidden system columns](https://www.postgresql.org/docs/current/ddl-system-columns.html), among which `xmin` holds the ID of the latest updating transaction. Since this value automatically gets updated every time the row is changed, it is ideal for use as a concurrency token.
+
+You can map a `uint` property to the PostgreSQL `xmin` system column using the standard EF Core mechanisms:
+
+### [Data Annotations](#tab/data-annotations)
+
+```csharp
+public class SomeEntity
+{
+ public int Id { get; set; }
+
+ [Timestamp]
+ public uint Version { get; set; }
+}
+```
+
+### [Fluent API](#tab/fluent-api)
+
+```csharp
+class MyContext : DbContext
+{
+ public DbSet SomeEntities { get; set; }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity()
+ .Property(b => b.Version)
+ .IsRowVersion();
+ }
+}
+
+public class SomeEntity
+{
+ public int Id { get; set; }
+ public uint Version { get; set; }
+}
+```
+
+***
+
+## Database concurrency failures
+
+Starting with version 11.0, PostgreSQL serialization failures (`40001`) and deadlocks (`40P01`) during `SaveChanges()` or `SaveChangesAsync()` are reported as `DbUpdateConcurrencyException`, with the original `PostgresException` as the inner exception. This also covers failures during the automatic transaction commit performed by `SaveChanges`. An explicit application call to commit a transaction is not covered by this conversion.
+
+As with other concurrency failures, the application must decide whether and how to retry the operation. See the [EF Core concurrency documentation](https://learn.microsoft.com/ef/core/saving/concurrency#resolving-concurrency-conflicts) and [execution strategies](../misc/other.md#execution-strategy).
diff --git a/docs/modeling/generated-properties.md b/docs/modeling/generated-properties.md
new file mode 100644
index 0000000000..b480ebae1f
--- /dev/null
+++ b/docs/modeling/generated-properties.md
@@ -0,0 +1,192 @@
+# Value Generation
+
+> [!NOTE]
+> It's recommended that you start by reading the general [Entity Framework Core docs on generated properties](https://docs.microsoft.com/en-us/ef/core/modeling/generated-properties).
+
+## Identity and serial columns (auto-increment)
+
+### Introduction
+
+The standard way to define auto-incrementing columns is "identity columns"; in older versions of PostgreSQL, "serial columns" were used, which are less SQL-compliant and generally more difficult to manage. For more information on these, [see this blog post](https://blog.2ndquadrant.com/postgresql-10-identity-columns/).
+
+The Npgsql EF Core provider allows you to choose which of the above you want on a property-by-property basis, or globally on your model. The following "value generation strategies" are available:
+
+* *Identity by default*: an identity column whose values are *by default* generated at the database, but you can still override this behavior by providing values from your application. This will generate the clause `GENERATED BY DEFAULT AS IDENTITY` on your column, and is the default value generation strategy.
+* *Identity always*: an identity column whose values are *always* generated at the database - you cannot provide values from your application. This will generate the clause `GENERATED ALWAYS AS IDENTITY` on your column.
+* *Serial*: the traditional PostgreSQL serial column. This will create the column with the `serial` datatype. Recommended only if you are using an older PostgreSQL version.
+* *Sequence HiLo*: See below
+
+The default value generation strategy is "identity by default". In other words, when EF decides that an int property should be value generated (e.g. because it's named `Id`, or because you explicitly specified `ValueGeneratedOnAdd` on it), the Npgsql provider will automatically map it to an identity column.
+
+### Defining the default strategy for the entire model
+
+You can easily control the value generation strategy for the entire model. For example, to opt out of the change to identity columns, simply place the following in your context's `OnModelCreating()`:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.UseIdentityByDefaultColumns();
+```
+
+Starting with version 11.0, you can disable the default PostgreSQL value generation strategy for the entire model:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.UseNoIdentityGeneration();
+```
+
+Explicitly configured property strategies are unaffected. This does not disable EF value generation or remove database defaults or computed expressions; use `ValueGeneratedNever()` to disable value generation for an individual property.
+
+### Defining the strategy for a single property
+
+Regardless of the model default, you can define a value-generation strategy on a property-by-property basis:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity().Property(b => b.Id).UseIdentityAlwaysColumn();
+```
+
+### Identity sequence options
+
+Identity columns have a standard sequence, managed behind the scenes by PostgreSQL; you can customize the sequence options for these. For example, the following makes the column values start at 100:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity().Property(b => b.Id)
+ .HasIdentityOptions(startValue: 100);
+```
+
+This can be especially useful when seeding data. Seeded data must explicitly specify all columns - including database-generated ones - but the backing sequence for identity columns isn't aware that the values are in use, and will generate conflicting values. This technique allows to start your identity sequence at a value higher than all seeded data values. Another strategy is to seed negative values only, allowing your identity column to start at 1.
+
+It is not possible to specify sequence options for serial columns, but you can set up a sequence separately and configure the column's default value (see [sequence-driven columns](#standard-sequence-driven-columns)).
+
+## Standard sequence-driven columns
+
+While identity and serial columns set up a sequence for you behind the scenes, sometimes you may want to manage sequence creation yourself. For example, you may want to have multiple columns drawing their default values from a single sequence. Adding a sequence to your model is described in [the general EF Core documentation](https://docs.microsoft.com/ef/core/modeling/relational/sequences); once the sequence is specified, you can simply set a column's default value to extract the next value from that sequence. Note that the SQL used to fetch the next value from a sequence differs across databases (see [the PostgreSQL docs](https://www.postgresql.org/docs/current/static/functions-sequence.html)). Your models' `OnModelCreating` should look like this:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.HasSequence("OrderNumbers")
+ .StartsAt(1000)
+ .IncrementsBy(5);
+
+ modelBuilder.Entity()
+ .Property(o => o.OrderNo)
+ .HasDefaultValueSql("nextval('\"OrderNumbers\"')");
+}
+```
+
+## HiLo Autoincrement Generation
+
+One disadvantage of database-generated values is that these values must be read back from the database after a row is inserted. If you're saving multiple related entities, this means you must perform multiple round-trips as the first entity's generated key must be read before writing the second one. One solution to this problem is HiLo value generation: rather than relying on the database to generate each and every value, the application "allocates" a range of values, which it can then populate directly on new entities without any additional round-trips. When the range is exhausted, a new range is allocated. In practical terms, this uses a sequence that increments by some large value (100 by default), allowing the application to insert 100 rows autonomously.
+
+To use HiLo, specify `UseHiLo` on a property in your model's `OnModelCreating`:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .Property(b => b.Id)
+ .UseHiLo();
+```
+
+You can also make your model use HiLo everywhere:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.UseHiLo();
+```
+
+## GUID/UUID Generation
+
+By default, for GUID key properties, a GUID is generated client-side by the EF provider and sent to the database. From version 9.0 and onwards, these GUIDs are sequential (version 7), which are more optimized for database indexes (before version 9.0, these GUIDs were random).
+
+To have the provider generate GUIDs client-side for **non-key** properties, configure them as follows:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder
+ .Entity()
+ .Property(b => b.SomeGuidProperty)
+ .HasValueGenerator();
+}
+```
+
+If you prefer to generate values in the database instead, you can do so by specifying `HasDefaultValueSql` on your property, and call the function to generate the value in the SQL expression. Starting with PostgreSQL 18, version 7 GUIDs can be generated, which are optimized for database indexes:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder
+ .Entity()
+ .Property(e => e.SomeGuidProperty)
+ .HasDefaultValueSql("uuidv7()");
+}
+```
+
+Prior to PostgreSQL 18, you can use an extension such as `pg_uuidv7` to generate version 7 GUIDs, or generate random version 7 GUIDs instead:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder
+ .Entity()
+ .Property(e => e.SomeGuidProperty)
+ .HasDefaultValueSql("uuid_generate_v4()");
+}
+```
+
+However, note that such version 4 GUIDs perform significantly worse with database indexes.
+
+See [the PostgreSQL docs on UUID for more details](https://www.postgresql.org/docs/current/static/datatype-uuid.html).
+
+> [!NOTE]
+> Generating `Guid` values in the database causes an additional network roundtrip when a principal and a dependent are inserted in the same `SaveChanges`, as the principal's key needs to be fetched before inserting the dependent's.
+
+## Timestamp generation
+
+In many scenarios, it's useful to have a column containing the timestamp when the row was originally created. To do this, add a `DateTime` property to your entity type (or `Instant` if using NodaTime) , and configure its default with `HasDefaultValueSql` as follows:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder
+ .Entity()
+ .Property(e => e.SomeDateTimeProperty)
+ .HasDefaultValueSql("now()");
+}
+```
+
+In other scenarios, a "last updated" is needed, which is automatically updated every time is modified. Unfortunately, while PostgreSQL supports [generated columns](https://www.postgresql.org/docs/current/ddl-generated-columns.html), the use of functions such as `now()` isn't supported. It's still possible to use database trigger to set this up; triggers can be managed by [adding raw SQL to your migrations](https://docs.microsoft.com/ef/core/managing-schemas/migrations/managing#adding-raw-sql), as follows:
+
+```sql
+CREATE FUNCTION "Blogs_Update_Timestamp_Function"() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$
+BEGIN
+ NEW."Timestamp" := now();
+ RETURN NEW;
+END;
+$$;
+
+CREATE TRIGGER "UpdateTimestamp"
+ BEFORE INSERT OR UPDATE
+ ON "Blogs"
+ FOR EACH ROW
+ EXECUTE FUNCTION "Blogs_Update_Timestamp_Function"();
+```
+
+## Computed (generated) columns
+
+EF computed columns - or generated columns, as they're called in PostgreSQL - are fully supported:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity()
+ .Property(p => p.DisplayName)
+ .HasComputedColumnSql(@"""FirstName"" || ' ' || ""LastName""", stored: true);
+}
+```
+
+The above creates a *stored* generated column, meaning that it's computed when a row is inserted or updated, and take up space on disk just like regular columns. PostgreSQL 18 introduced support for *virtual* generated columns, which are instead calculated when read, and take up no space on disk. Virtual generated columns are the default - simply omit `stored: true` above to create them.
+
+See the [EF documentation](https://learn.microsoft.com/ef/core/modeling/generated-properties#computed-columns) and the [PostgreSQL documentation](https://www.postgresql.org/docs/current/ddl-generated-columns.html) for more information.
diff --git a/docs/modeling/indexes.md b/docs/modeling/indexes.md
new file mode 100644
index 0000000000..817ddad465
--- /dev/null
+++ b/docs/modeling/indexes.md
@@ -0,0 +1,90 @@
+# Indexes
+
+PostgreSQL and the Npgsql provider support the standard index modeling described in [the EF Core docs](https://docs.microsoft.com/ef/core/modeling/indexes). This page describes some supported PostgreSQL-specific features.
+
+## Covering indexes (INCLUDE)
+
+PostgreSQL supports [covering indexes](https://paquier.xyz/postgresql-2/postgres-11-covering-indexes), which allow you to include "non-key" columns in your indexes. This allows you to perform index-only scans and can provide a significant performance boost:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .HasIndex(b => b.Id)
+ .IncludeProperties(b => b.Name);
+```
+
+This will create an index for searching on `Id`, but containing also the column `Name`, so that reading the latter will not involve accessing the table. The SQL generated is as follows:
+
+```sql
+CREATE INDEX "IX_Blog_Id" ON blogs ("Id") INCLUDE ("Name");
+```
+
+## Treating nulls as non-distinct
+
+By default, when you create a unique index, PostgreSQL treats null values as distinct; this means that a unique index can contain multiple null values in a column. When creating an index, you can also instruct PostgreSQL that nulls should be treated as *non-distinct*; this causes a unique constraint violation to be raised if a column contains multiple null values:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .IsUnique()
+ .AreNullsDistinct(false);
+```
+
+## Index methods
+
+PostgreSQL supports a number of *index methods*, or *types*. These are specified at index creation time via the `USING ` clause, see the [PostgreSQL docs for `CREATE INDEX`](https://www.postgresql.org/docs/current/static/sql-createindex.html) and [this page](https://www.postgresql.org/docs/current/static/indexes-types.html) for information on the different types.
+
+The Npgsql EF Core provider allows you to specify the index method to be used by calling `HasMethod()` on your index in your context's `OnModelCreating` method:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .HasIndex(b => b.Url)
+ .HasMethod("gin");
+```
+
+## Index operator classes
+
+PostgreSQL allows you to specify [operator classes on your indexes](https://www.postgresql.org/docs/current/indexes-opclass.html), to allow tweaking how the index should work. Use the following code to specify an operator class:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder builder)
+ => modelBuilder.Entity()
+ .HasIndex(b => new { b.Id, b.Name })
+ .HasOperators(null, "text_pattern_ops");
+```
+
+Note that each operator class is used for the corresponding index column, by order. In the example above, the `text_pattern_ops` class will be used for the `Name` column, while the `Id` column will use the default class (unspecified), producing the following SQL:
+
+```sql
+CREATE INDEX "IX_blogs_Id_Name" ON blogs ("Id", "Name" text_pattern_ops);
+```
+
+## Storage parameters
+
+PostgreSQL allows configuring indexes with *storage parameters*, which can tweak their behaviors in various ways; which storage parameters are available depends on the chosen index method. [See the PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS) for more information.
+
+To configure a storage parameter on an index, use the following code:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .HasIndex(b => b.Url)
+ .HasStorageParameter("fillfactor", 70);
+```
+
+## Creating indexes concurrently
+
+Creating an index can interfere with regular operation of a database. Normally PostgreSQL locks the table to be indexed against writes and performs the entire index build with a single scan of the table. Other transactions can still read the table, but if they try to insert, update, or delete rows in the table they will block until the index build is finished. This could have a severe effect if the system is a live production database. Very large tables can take many hours to be indexed, and even for smaller tables, an index build can lock out writers for periods that are unacceptably long for a production system.
+
+The EF provider allows you to specify that an index should be created *concurrently*, partially mitigating the above issues:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity()
+ .HasIndex(b => b.Url)
+ .IsCreatedConcurrently();
+```
+
+> [!CAUTION]
+> Do not enable this feature before reading the [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY) and understanding the full implications of concurrent index creation.
diff --git a/docs/modeling/tables.md b/docs/modeling/tables.md
new file mode 100644
index 0000000000..76a0ef1e12
--- /dev/null
+++ b/docs/modeling/tables.md
@@ -0,0 +1,47 @@
+# Tables
+
+## Naming
+
+By default, EF Core will map to tables and columns named exactly after your .NET classes and properties, so an entity type named `BlogPost` will be mapped to a PostgreSQL table called `BlogPost`. While there's nothing wrong with that, the PostgreSQL world tends towards snake_case naming instead. In addition, any upper-case letters in unquoted identifiers are automatically converted to lower-case identifiers, so the Npgsql provider generates quotes around all such identifiers.
+
+The [EFCore.NamingConventions](https://github.com/efcore/EFCore.NamingConventions) plugin to automatically set all your table and column names to snake_case instead:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder
+ .UseNpgsql(...)
+ .UseSnakeCaseNamingConvention();
+
+public class Customer {
+ public int Id { get; set; }
+ public string FullName { get; set; }
+}
+```
+
+This will cause cleaner SQL such as the following to be generated:
+
+```sql
+CREATE TABLE customers (
+ id integer NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ full_name text NULL,
+ CONSTRAINT "PK_customers" PRIMARY KEY (id);
+
+SELECT c.id, c.full_name
+ FROM customers AS c
+ WHERE c.full_name = 'John Doe';
+```
+
+However, note that the EFCore.NamingConventions isn't an official part of EF (or of the PostgreSQL provider), and sometimes lags behind in terms of support.
+
+See the [plugin documentation](https://github.com/efcore/EFCore.NamingConventions) for more details,
+
+## Storage parameters
+
+PostgreSQL allows configuring tables with *storage parameters*, which can tweak storage behavior in various ways; [see the PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS) for more information.
+
+To configure a storage parameter on a table, use the following code:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.Entity().HasStorageParameter("fillfactor", 70);
+```
diff --git a/docs/release-notes/1.1.md b/docs/release-notes/1.1.md
new file mode 100644
index 0000000000..39d0628e81
--- /dev/null
+++ b/docs/release-notes/1.1.md
@@ -0,0 +1,46 @@
+# Migrating to 1.1
+
+Version 1.1.0 of the Npgsql Entity Framework Core provider has been released and is available on nuget. This version works with [version 1.1.0 of Entity Framework Core](https://blogs.msdn.microsoft.com/dotnet/2016/10/25/announcing-entity-framework-core-1-1-preview-1/), and contains some new Npgsql features as well. Note that if you're using the command-line tools, you'll have to modify your tools section as described in the EF Core release post:
+
+```json
+"tools": {
+ "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
+},
+```
+
+## New Features
+
+Aside from general EF Core features, version 1.1.0 of the Npgsql provider contains the following:
+
+* Hilo key generation ([#5](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/5)). This can be a much more efficient way to generate autoincrement key values.
+* PostgreSQL array mapping ([#15](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/15)). This allows you to have plain CLR arrays on your entities, and have those arrays mapped to native [PostgreSQL array columns](https://www.postgresql.org/docs/current/static/arrays.html).
+* Optimistic concurrency with PostgreSQL's xmin column ([#19](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/19)). Simply specify `.UseXminAsConcurrencyToken()` on an entity to start using this, see the [EF docs for more details](https://docs.efproject.net/en/latest/modeling/concurrency.html).
+* Cleanup of how serial (autoincrement) and generated GUID/UUID columns are managed.
+
+Here's the [full list of issues](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/milestone/3?closed=1). Please report any problems to .
+
+## Upgrading from 1.0.x
+
+If you've used 1.0.x without migrations, you can simply upgrade and everything should just work. Unfortunately, if you already have migrations from 1.0.x you'll have to do some manual fixups because of some bad decisions that were previously made. If deleting your old migrations and starting over (e.g. non-production database) is an option, you may wish to do so. The following are instructions for fixing up 1.0.x migrations.
+
+First, Npgsql 1.0.x used a problematic method to identify serial (autoincrement) columns in migrations. If you look at your migration code you'll see `.Annotation("Npgsql:ValueGeneratedOnAdd", true)` on various columns. Unfortunately this annotation is also present on non-serial columns, e.g. columns with default values. This causes various issues and has been replaced in 1.1. However, you'll have to manually remove `.Annotation("Npgsql:ValueGeneratedOnAdd", true)`, and replace it with `.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)` but *only* on columns which should be serial (e.g. not on columns with defaults). If you attempt to run a migration that has the old annotation, Npgsql will throw an exception and refuse to run your migrations.
+
+Unfortunately, this change will cause some incorrect changes the first time you add a migration after the upgrade. To avoid this, simply add a dummy migration right after upgrading to 1.1 and then delete the two new files generated for the dummy migration, *but keep the changes made to your ModelSnapshot.cs*. From this point on everything should be fine. *Make sure you have no pending changes to your model before doing this!*.
+
+Apologies for this problematic upgrade procedure, it should at least keep things clean going forward.
+
+## Contributors
+
+Thank you very much to the following people who have contributed to the individual 1.1.x. releases.
+
+### [Milestone 1.1.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A1.1.1)
+
+Contributor | Assigned issues
+-------------------------------- | ---------------:|
+[@roji](https://github.com/roji) | [8](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A1.1.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 1.1.0](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A1.1.0)
+
+Contributor | Assigned issues
+-------------------------------- | ---------------:|
+[@roji](https://github.com/roji) | [11](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A1.1.0+is%3Aclosed+assignee%3Aroji)
diff --git a/docs/release-notes/10.0.md b/docs/release-notes/10.0.md
new file mode 100644
index 0000000000..993247030c
--- /dev/null
+++ b/docs/release-notes/10.0.md
@@ -0,0 +1,189 @@
+# 10.0 Release Notes
+
+Npgsql.EntityFrameworkCore.PostgreSQL version 10.0 is out and available on [nuget.org](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL).
+
+## Full support for EF 10 JSON complex types
+
+EF 10 introduced support for mapping .NET types as JSON complex types, resolving several issues that existed with the previous JSON mapping via owned entities ([see release notes for more information](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-10.0/whatsnew#json)). The PG provider providers full support for this feature full support for this as well:
+
+```c#
+modelBuilder.Entity(b =>
+{
+ b.ComplexProperty(c => c.ShippingAddress, c => c.ToJson());
+ b.ComplexProperty(c => c.BillingAddress, c => c.ToJson());
+});
+```
+
+This configuration causes the following table to be created for your customers:
+
+```sql
+CREATE TABLE "Customers" (
+ "Id" integer GENERATED BY DEFAULT AS IDENTITY,
+ "Name" text,
+ "BillingAddress" jsonb NOT NULL,
+ "ShippingAddress" jsonb NOT NULL,
+ CONSTRAINT "PK_Customers" PRIMARY KEY ("Id")
+);
+```
+
+This is now the preferred way to perform strongly-typed JSON mapping of arbitrary .NET types, and replaces owned entities and [legacy POCO mapping](../mapping/json.md?#legacy-poco-mapping-deprecated).
+
+The provider now also supports performing partial updates within JSON documents using `ExecuteUpdate`. For example, the following efficiently copies overwrites all Customers' shipping address streets with their billing address streets:
+
+```c#
+await context.Customers.ExecuteUpdateAsync(s =>
+ s.SetProperty(b => b.ShippingAddress.Street, b => b.BillingAddress.Street));
+```
+
+This produces the following SQL:
+
+```sql
+UPDATE "Customers" AS c
+SET "ShippingAddress" = jsonb_set(c."ShippingAddress", '{Street}', c."BillingAddress" -> 'Street')
+```
+
+## Better support for JSON scalar (primitive) collections
+
+In most relational databases, scalar collections are mapped to a JSON column, the the collection is serialized to a JSON array in the database. PostgreSQL, however, is unique in providing a 1st-class array type, so the EF provider maps scalar collections to array instead. For example, given the following type:
+
+```c#
+public class Customer
+{
+ public int Id { get; set; }
+ public string[] Tags { get; set; }
+}
+```
+
+... the PostgreSQL provider will create the following table (note that `text[]` array column):
+
+```sql
+CREATE TABLE "Customers" (
+ "Id" integer GENERATED BY DEFAULT AS IDENTITY,
+ "Tags" text[] NOT NULL,
+ CONSTRAINT "PK_Customers" PRIMARY KEY ("Id")
+);
+```
+
+However, when scalar collections are nested within a JSON document, they must be mapped to JSON arrays, as in other databases:
+
+```c#
+public class Customer
+{
+ public int Id { get; set; }
+ public Address Address { get; set; }
+}
+
+public class Address
+{
+ // ...
+
+ public string[] Tags { get; set; }
+}
+```
+
+Version 10 of the provider now produces much better SQL when querying such nested scalar collections. For example, when querying using Contains:
+
+```c#
+var customers = await context.Customers.Where(b => b.ShippingAddress.Tags.Contains("foo")).ToListAsync();
+```
+
+... previous versions of the provider generated the following complicated (and inefficient) SQL:
+
+```sql
+SELECT c."Id", c."Name", c."ShippingAddress"
+FROM "Customers" AS c
+WHERE 'foo' = ANY ((ARRAY(SELECT CAST(element AS text) FROM jsonb_array_elements_text(c."ShippingAddress" -> 'Tags') WITH ORDINALITY AS t(element) ORDER BY ordinality)))
+```
+
+Version 10, in contrast, produces the following cleaner SQL, which can also benefit from indexes:
+
+```sql
+SELECT c."Id", c."Name", c."ShippingAddress"
+FROM "Customers" AS c
+WHERE (c."ShippingAddress" -> 'Tags') @> to_jsonb('foo'::text)
+```
+
+Finally, version 10 of the provider also allows you to map a non-nested scalar collection to a JSON column, instead of to an array column, and provides fully querying capabilities:
+
+```c#
+public class Customer
+{
+ // ...
+
+ [Column(TypeName = "jsonb")]
+ public string[] Tags { get; set; }
+}
+```
+
+## Support for PostgreSQL 18 virtual generated columns
+
+Before PostgreSQL 18, generated (or "computed") columns could only be stored, meaning they were computed when a row is inserted or updated, and take up space on disk just like regular columns. PostgreSQL 18 introduced support for *virtual* generated columns, which are instead calculated when read, and take up no space on disk. Virtual columns can be defined with version 10 of the PostgreSQL provider as follows:
+
+```c#
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity()
+ .Property(p => p.DisplayName)
+ .HasComputedColumnSql(@"""FirstName"" || ' ' || ""LastName""");
+}
+```
+
+Note that previously, `stored: true` had to be specified in the above code sample; starting with version 10, omitting it causes a virtual generated column to be created (supported on PostgreSQL 18 only).
+
+For more information, [see the documentation](../modeling/generated-properties.md#computed-generated-columns).
+
+## Support for UUIDv7
+
+By default, EF generates GUID (or UUID) values locally in .NET, rather than relying on the database to generate them. Version 9 of the PG provider already switched to generating UUIDv7 values by default ([see release note](9.0.md#uuidv7-guids-are-generated-by-default)), which are significantly better for database indexes. PostgreSQL 18 also added the [`uuidv7()`](https://www.postgresql.org/docs/18/functions-uuid.html#FUNC_UUID_GEN_TABLE) built-in function, which allows database generation of UUIDv7 values. In EFCore.PG 10, if you configure the provider to target PG 18 (`.UseNpgsql("...", o => o.SetPostgresVersion(18, 0))`), the provider will also translate [`Guid.CreateVersion7()`](https://learn.microsoft.com/dotnet/api/system.guid.createversion7) to that function.
+
+## Support for the cube extension
+
+PostgreSQL bundles the [`cube`](https://www.postgresql.org/docs/current/cube.html) extension, which provides a multi-dimensional cube data type and associated operations. EFCore.PG 10 now fully supports the `cube` type out-of-the-box, simply add an `NpgsqlCube` property to your entity type:
+
+```c#
+public class Blog
+{
+ ...
+
+ public NpgsqlCube Cube { get; set; }
+}
+```
+
+Most translations over the type are supported as well. Thanks to [@kirkbrauer](https://github.com/kirkbrauer) for contributing this feature!
+
+## Other new features
+
+* NodaTime `LocalDate.At()` and `LocalDate.AtMidnight()` are now translated.
+
+See the [10.0.0 milestone](https://github.com/npgsql/efcore.pg/milestone/68?closed=1) for the full list of Npgsql EF provider issues.
+
+## Breaking changes
+
+### Array `Contains` translation now defaults to `ANY`
+
+Translation for array `Contains` was changed in 10.0: `arrayColumn.Contains(element)` now defaults to `element = ANY(arrayColumn)` (instead of `arrayColumn @> ARRAY[element]`). This can impact performance depending on your indexes: `@>` can be much faster with a GIN index over the array column, while `ANY` can be better when that GIN index is missing.
+
+Previous SQL:
+
+```sql
+WHERE array_column @> ARRAY[@__element_0]::text[]
+```
+
+New default SQL:
+
+```sql
+WHERE @__element_0 = ANY (array_column)
+```
+
+To tell EF that a GIN index exists and revert to the previous `@>` translation, model that index:
+
+```csharp
+modelBuilder.Entity
- ()
+ .HasIndex(i => i.ArrayColumn)
+ .HasMethod("gin");
+```
+
+### Other breaking changes
+
+* `EF.Functions.Network()` and `EF.Functions.Merge()` have been changed to return the new .NET [`IPNetwork`](https://learn.microsoft.com/dotnet/api/system.net.ipnetwork) instead of the obsolete `NpgsqlCidr`. The new `IPNetwork` type works with all other functions as well (but no breaking changes were necessary).
+* The PostgreSQL network type `cidr` is now scaffolded to the new .NET [`IPNetwork`](https://learn.microsoft.com/dotnet/api/system.net.ipnetwork) type. The older Npgsql representation for `cidr` - the `NpgsqlCidr` type - has been obsoleted and will be removed in a future release.
diff --git a/docs/release-notes/11.0.md b/docs/release-notes/11.0.md
new file mode 100644
index 0000000000..9ec1c68c7d
--- /dev/null
+++ b/docs/release-notes/11.0.md
@@ -0,0 +1,195 @@
+# 11.0 Release Notes
+
+Npgsql.EntityFrameworkCore.PostgreSQL 11.0.0 is available on [NuGet](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL/11.0.0).
+
+## Indexes over JSON members
+
+EF 11 complex types mapped with `ToJson()` now support indexing JSON members through the existing `HasIndex` APIs, including unique and composite indexes. By default, these create B-tree expression indexes over the selected values; explicit GIN indexes can target `jsonb` arrays and subdocuments. See [Indexing JSON columns](../mapping/json.md#indexing-json-columns) for examples and limitations.
+
+## PostgreSQL JSON functions with ToJson
+
+The existing PostgreSQL JSON functions, such as `EF.Functions.JsonContains()` and `EF.Functions.JsonExists()`, can now be used with complex types and owned entities mapped with `ToJson()`, including nested objects and collections:
+
+```csharp
+var customers = await context.Customers
+ .Where(c => EF.Functions.JsonContains(c.Details, """{"Name": "Joe"}"""))
+ .ToListAsync();
+```
+
+## Support for PostgreSQL 18 temporal constraints
+
+PostgreSQL 18 introduced powerful temporal constraints that allow enforcing data integrity over time periods directly at the database level. The EF Core provider now supports these features, allowing you to define temporal primary keys, unique constraints, and foreign keys.
+
+### WITHOUT OVERLAPS for keys
+
+Temporal primary and alternate keys use the `WITHOUT OVERLAPS` clause to ensure that for any given set of scalar column values, the associated time ranges do not overlap. This is useful for scenarios where you need to track historical data (e.g. employee records, pricing information, equipment assignments) while ensuring data integrity.
+
+For example, an employee can have multiple records in the database (reflecting changes over time), but their validity periods must never overlap:
+
+```csharp
+public class Employee
+{
+ public int EmployeeId { get; set; }
+ public string Name { get; set; }
+ public string Department { get; set; }
+ public decimal Salary { get; set; }
+ public NpgsqlRange ValidPeriod { get; set; }
+}
+
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity(b =>
+ {
+ b.Property(e => e.ValidPeriod)
+ .HasDefaultValueSql("tstzrange(now(), 'infinity', '[)')");
+
+ b.HasKey(e => new { e.EmployeeId, e.ValidPeriod })
+ .WithoutOverlaps();
+ });
+}
+```
+
+This generates the following SQL:
+
+```sql
+CREATE TABLE employees (
+ employee_id INTEGER,
+ name VARCHAR(100) NOT NULL,
+ department VARCHAR(50) NOT NULL,
+ salary DECIMAL(10,2) NOT NULL,
+ valid_period tstzrange NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
+ PRIMARY KEY (employee_id, valid_period WITHOUT OVERLAPS)
+);
+```
+
+### PERIOD for temporal foreign keys
+
+Temporal foreign keys use the `PERIOD` clause to ensure that the referenced row exists during the entire time period of the referencing row. This maintains referential integrity across temporal relationships.
+
+For example, when assigning employees to projects, the assignment period must fall within the employee's validity period:
+
+```csharp
+public class ProjectAssignment
+{
+ public int AssignmentId { get; set; }
+ public int EmployeeId { get; set; }
+ public string ProjectName { get; set; }
+ public NpgsqlRange AssignmentPeriod { get; set; }
+}
+
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.Entity(b =>
+ {
+ b.HasOne()
+ .WithMany()
+ .HasForeignKey(e => new { e.EmployeeId, e.AssignmentPeriod })
+ .HasPrincipalKey(e => new { e.EmployeeId, e.ValidPeriod })
+ .WithPeriod();
+ });
+}
+```
+
+This generates the following SQL:
+
+```sql
+ALTER TABLE project_assignments
+ADD CONSTRAINT fk_emp_temporal
+FOREIGN KEY (employee_id, PERIOD assignment_period)
+REFERENCES employees (employee_id, PERIOD valid_period);
+```
+
+Temporal constraints also support NodaTime `Interval` and `DateInterval` properties when the NodaTime plugin is enabled. For more details, see the [temporal constraints documentation](../misc/temporal-constraints.md).
+
+## New translations
+
+EFCore.PG 11 brings many new query translations across the board:
+
+| .NET | SQL | Notes |
+| ---- | --- | ----- |
+| [EF.Functions.DateTrunc("month", value)](../mapping/translations.md#date-and-time-functions) | date_trunc('month', value) | Also supports [NodaTime types](../mapping/nodatime.md#operation-translation) and an optional time zone for timestamptz ([#3831](https://github.com/npgsql/efcore.pg/issues/3831)). |
+| [EF.Functions.JsonPathExists(json, "$.Age")](../mapping/translations.md#json-functions) | JSON_EXISTS(json, '$.Age') | PostgreSQL 17+ ([#3733](https://github.com/npgsql/efcore.pg/issues/3733)). |
+| [EF.Functions.FuzzyStringMatchDaitchMokotoff(text)](../mapping/translations.md#fuzzy-string-match-functions) | daitch_mokotoff(text) | Requires fuzzystrmatch on PostgreSQL 16+ ([#3524](https://github.com/npgsql/efcore.pg/issues/3524)). |
+| [TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dateTime, sourceTimeZoneId, destinationTimeZoneId)](../mapping/translations.md#date-and-time-functions) | (dateTime AT TIME ZONE sourceTimeZoneId) AT TIME ZONE destinationTimeZoneId | timestamp without time zone ([#3938](https://github.com/npgsql/efcore.pg/issues/3938)). |
+| [dateTime.Millisecond](../mapping/translations.md#date-and-time-functions) | floor(date_part('milliseconds', dateTime))::INT % 1000 | Also DateTimeOffset, TimeOnly ([#3406](https://github.com/npgsql/efcore.pg/issues/3406)). |
+| [dateTime.Microsecond](../mapping/translations.md#date-and-time-functions) | date_part('microseconds', dateTime)::INT % 1000 | Also DateTimeOffset, TimeOnly ([#3406](https://github.com/npgsql/efcore.pg/issues/3406)). |
+| [dateTime.AddMilliseconds(value)](../mapping/translations.md#date-and-time-functions) | dateTime + value * INTERVAL '1 milliseconds' | Also DateTimeOffset ([#3449](https://github.com/npgsql/efcore.pg/issues/3449)). |
+| [dateTime.AddMicroseconds(value)](../mapping/translations.md#date-and-time-functions) | dateTime + value * INTERVAL '1 microseconds' | Also DateTimeOffset ([#3449](https://github.com/npgsql/efcore.pg/issues/3449)). |
+| [LocalDateTime.ToDateTimeUnspecified()](../mapping/nodatime.md#operation-translation) | No PG operation | NodaTime ([#4048](https://github.com/npgsql/efcore.pg/issues/4048)). |
+| stringValue.IndexOf(value) | strpos(stringValue, value) - 1 | char overload ([#3547](https://github.com/npgsql/efcore.pg/issues/3547)). |
+| stringValue.Replace(oldValue, newValue) | replace(stringValue, oldValue, newValue) | char overload |
+| stringValue.StartsWith(value) | stringValue LIKE value \|\| '%' | char overload |
+| stringValue.EndsWith(value) | stringValue LIKE '%' \|\| value | char overload |
+| stringValue.Contains(value) | stringValue LIKE %value% | char overload |
+| int.Parse(stringValue) | CAST(stringValue AS integer) | Also bool, byte, short, long, float, double and decimal |
+| [array1.Take(2).SequenceEqual(array2)](../mapping/array.md#operation-translation) | array1\[:2\] = array2 | Also Skip() and Skip().Take() ([#3633](https://github.com/npgsql/efcore.pg/issues/3633)). |
+| [array1.Intersect(array2).Any()](../mapping/array.md#operation-translation) | array1 && array2 | Now supports static readonly collections with non-null elements ([#3638](https://github.com/npgsql/efcore.pg/issues/3638)). |
+| [bytes.Any()](../mapping/translations.md#binary-functions) | length(bytes) > 0 | byte[] mapped to bytea |
+| [bytes.Concat(bytes2)](../mapping/translations.md#binary-functions) | bytes \|\| bytes2 | byte[] columns mapped to bytea ([#2200](https://github.com/npgsql/efcore.pg/pull/2200)). |
+| [bitArray.Get(index)](../mapping/translations.md#binary-functions) | get_bit(bitArray, index) = 1 | Also bitArray[index] ([#2836](https://github.com/npgsql/efcore.pg/issues/2836)). |
+| [EF.Functions.IntersectsBbox(geom1, geom2)](../mapping/nts.md#operation-translation) | [geom1 && geom2](https://postgis.net/docs/geometry_overlaps.html) | Thanks to [@bjornharrtell](https://github.com/bjornharrtell)! |
+| [EF.Functions.LineInterpolatePoint(lineString, fraction)](../mapping/nts.md#operation-translation) | [ST_LineInterpolatePoint(lineString, fraction)](https://postgis.net/docs/ST_LineInterpolatePoint.html) | [#2632](https://github.com/npgsql/efcore.pg/issues/2632) |
+| [EF.Functions.LineMerge(geom)](../mapping/nts.md#operation-translation) | [ST_LineMerge(geom)](https://postgis.net/docs/ST_LineMerge.html) | [#2632](https://github.com/npgsql/efcore.pg/issues/2632) |
+| [EF.Functions.Scale(geom, xFactor, yFactor)](../mapping/nts.md#operation-translation) | [ST_Scale(geom, xFactor, yFactor)](https://postgis.net/docs/ST_Scale.html) | Also supports a zFactor; scales relative to the coordinate origin ([#829](https://github.com/npgsql/efcore.pg/issues/829)). |
+| [EF.Functions.SetSrid(geom, srid)](../mapping/nts.md#operation-translation) | [ST_SetSRID(geom, srid)](https://postgis.net/docs/ST_SetSRID.html) | Sets SRID metadata without changing coordinates; use Transform for reprojection ([#3245](https://github.com/npgsql/efcore.pg/issues/3245)). |
+
+The following [hstore translations](../mapping/translations.md#hstore-translations) are now supported for `Dictionary` and `ImmutableDictionary`, with additional operations specific to immutable dictionaries ([#4082](https://github.com/npgsql/efcore.pg/pull/4082)):
+
+| .NET | SQL | Notes |
+| ---- | --- | ----- |
+| dictionary[key] | dictionary -> key | Added in 11.0 |
+| dictionary.GetValueOrDefault(key) | dictionary -> key | Added in 11.0 |
+| dictionary.GetValueOrDefault(key, fallback) | CASE WHEN dictionary ? key THEN dictionary -> key ELSE fallback END | Added in 11.0 |
+| dictionary.ContainsKey(key) | dictionary ? key | Added in 11.0 |
+| dictionary.ContainsValue(value) | array_position(avals(dictionary), value) IS NOT NULL | Added in 11.0 |
+| dictionary.Count | cardinality(akeys(dictionary)) | Added in 11.0 |
+| immutableDictionary.IsEmpty | cardinality(akeys(immutableDictionary)) = 0 | Added in 11.0 |
+| immutableDictionary.Remove(key) | immutableDictionary - key | Added in 11.0 |
+| immutableDictionary.RemoveRange(keys) | immutableDictionary - keys | Added in 11.0 |
+| immutableDictionary.SetItems(otherDictionary) | immutableDictionary \|\| otherDictionary | Added in 11.0 |
+| keys.All(key => dictionary.ContainsKey(key)) | dictionary ?& keys | Added in 11.0 |
+| keys.Any(key => dictionary.ContainsKey(key)) | dictionary ?\| keys | Added in 11.0 |
+
+## Other new features
+
+* [Generated `tsvector` columns and full-text expression indexes](../mapping/full-text-search.md#setting-up-and-querying-a-full-text-search-index-on-an-entity) now support integer and exact-numeric inputs by casting them to text ([#2615](https://github.com/npgsql/efcore.pg/issues/2615)).
+* [`MapEnum`](../mapping/enum.md) now respects type-level `[PgName]` attributes when no PostgreSQL enum name is supplied ([#3379](https://github.com/npgsql/efcore.pg/issues/3379)).
+* Added [`ModelBuilder.UseNoIdentityGeneration()`](../modeling/generated-properties.md#defining-the-default-strategy-for-the-entire-model) to disable the model's default PostgreSQL identity generation strategy ([#3723](https://github.com/npgsql/efcore.pg/issues/3723)).
+* [Covering indexes](../modeling/indexes.md#covering-indexes-include) now support including properties nested within complex types mapped to regular columns.
+* Indexes configured with [`IsCreatedConcurrently()`](../modeling/indexes.md#creating-indexes-concurrently) are now also dropped concurrently when removed by migrations ([#3901](https://github.com/npgsql/efcore.pg/issues/3901)).
+* [Creating PostgreSQL extensions](../misc/other.md#postgresql-extensions) now uses `CASCADE` to install their dependencies automatically ([#3682](https://github.com/npgsql/efcore.pg/issues/3682)).
+* Support specifying the encoding of newly created PostgreSQL databases with `ModelBuilder.UseDatabaseEncoding()` ([#3526](https://github.com/npgsql/efcore.pg/issues/3526)).
+* Custom collation references now respect the model's default schema and correctly handle dots in collation and schema names across migrations, queries and scaffolding ([#4072](https://github.com/npgsql/efcore.pg/pull/4072)).
+
+See the [11.0.0 milestone](https://github.com/npgsql/efcore.pg/milestone/75?closed=1) for the full list of issues.
+
+## Breaking changes
+
+### The dependency injection extension class was renamed
+
+The provider's `NpgsqlServiceCollectionExtensions` class was renamed to `NpgsqlEntityFrameworkServiceCollectionExtensions` to avoid a name collision with the Npgsql driver. Extension-method calls such as `services.AddNpgsql(...)` and `services.AddEntityFrameworkNpgsql()` don't need source changes, but assemblies compiled against the old methods must be rebuilt. If your code references the class directly, update it to use the new name ([npgsql/efcore.pg#4139](https://github.com/npgsql/efcore.pg/pull/4139)).
+
+### PostgreSQL 16 is targeted by default
+
+The provider now assumes at least PostgreSQL 16 by default, taking advantage of newer features (previously, PostgreSQL 14 was targeted). You can configure the targeted PostgreSQL version when configuring your context:
+
+```c#
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql("", o => o.SetPostgresVersion(14, 0));
+```
+
+### Changes to transient and concurrency exceptions
+
+The default, non-retrying execution strategy no longer wraps transient failures in an additional `InvalidOperationException`. Applications catching that wrapper should instead handle the underlying exception.
+
+In addition, PostgreSQL serialization failures (`40001`) and deadlocks (`40P01`) during `SaveChanges()` or `SaveChangesAsync()` now throw `DbUpdateConcurrencyException`, with the original `PostgresException` as the inner exception. This includes failures during an automatically committed transaction, but not a transaction committed explicitly by the application. Previously, these failures were generally exposed as `DbUpdateException` wrapped in `InvalidOperationException`.
+
+These changes do not enable automatic retries. See [execution strategies](../misc/other.md#execution-strategy) and [database concurrency failures](../modeling/concurrency.md#database-concurrency-failures) for details ([#3098](https://github.com/npgsql/efcore.pg/issues/3098)).
+
+### Initial migration rollback removes model-level objects
+
+Rolling back a newly scaffolded initial migration now drops enum, range and collation definitions that were previously left behind. If other applications use these objects, the rollback can fail due to their dependencies; remove the corresponding drop operations from `Down()` if the objects must be preserved ([#3604](https://github.com/npgsql/efcore.pg/issues/3604)).
+
+### Collation annotations containing literal double quotes
+
+Previously scaffolded snapshots and migrations with raw collation annotation keys containing literal double quotes in collation or schema names can be misinterpreted by the new identifier encoding. They may fail to decode or reference the wrong collation; update affected annotation keys manually before using them with 11.0 ([#4072](https://github.com/npgsql/efcore.pg/pull/4072)).
diff --git a/docs/release-notes/2.0.md b/docs/release-notes/2.0.md
new file mode 100644
index 0000000000..12b70b01a8
--- /dev/null
+++ b/docs/release-notes/2.0.md
@@ -0,0 +1,41 @@
+# 2.0 Release Notes
+
+Version 2.0.0 of the Npgsql Entity Framework Core provider has been released and is available on [nuget.org](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL). This version works with [version 2.0.0 of Entity Framework Core](https://blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-entity-framework-core-2-0/), and contains some new Npgsql features as well.
+
+## New Features
+
+Aside from general EF Core features new in 2.0.0, the Npgsql provider contains the following major new features:
+
+* PostgreSQL array operation translation ([#120](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/120)). While array properties have been supported since 1.1, operations on those arrays where client-evaluated. Version 2.0 will now translate array indexing, `.Contains()`, `.SequenceEquals()` and `.Length`. See the [array mapping docs](../mapping/array.md) for more details.
+* A retrying execution strategy ([#155](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/155)), which will automatically retry operations on exceptions which are considered transient.
+* PostgreSQL extensions are now included in scaffolded models ([#102](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/102)).
+* More LINQ operations are translated to SQL, and more database scenarios are scaffolded correctly (see [the docs](http://www.npgsql.org/efcore/mapping-and-translation.html)).
+
+Here's the [full list of issues](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/milestone/6?closed=1). Please report any problems to .
+
+## Upgrading from 1.x
+
+* Previously an Npgsql.EntityFrameworkCore.PostgreSQL.Design nuget package existed alongside the main package. Its contents have been merged into the main Npgsql.EntityFrameworkCore.PostgreSQL and no new version has been released.
+* Specifying versions when specifying PostgreSQL extensions on your model is no longer supported - this was a very rarely-used feature which interfered with extension scaffolding.
+
+## Contributors
+
+Thank you very much to the following people who have contributed to the individual 2.0.x. releases.
+
+### [Milestone 2.0.2](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.0.2)
+
+Contributor | Assigned issues
+-------------------------------- | ---------------:|
+[@roji](https://github.com/roji) | [4](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.0.2+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 2.0.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.0.1)
+
+Contributor | Assigned issues
+-------------------------------- | ---------------:|
+[@roji](https://github.com/roji) |[5](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.0.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 2.0.0](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.0.0)
+
+Contributor | Assigned issues
+-------------------------------- | ---------------:|
+[@roji](https://github.com/roji) | [16](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.0.0+is%3Aclosed+assignee%3Aroji)
diff --git a/docs/release-notes/2.1.md b/docs/release-notes/2.1.md
new file mode 100644
index 0000000000..4362191ac7
--- /dev/null
+++ b/docs/release-notes/2.1.md
@@ -0,0 +1,119 @@
+# 2.1 Release Notes
+
+Version 2.1.0 of the Npgsql Entity Framework Core provider has been released and is available on nuget. This version works with [version 2.1.0 of Entity Framework Core](https://docs.microsoft.com/ef/core/what-is-new/ef-core-2.1), and contains some new Npgsql features as well.
+
+Thanks to [@rwasef1830](https://github.com/rwasef1830) and [@austindrenski](https://github.com/austindrenski) for their valuable contributions.
+
+## New Features
+
+Aside from general EF Core features new in 2.1.0, the Npgsql provider contains the following major new features:
+
+### Improved Spatial Support (PostGIS)
+
+Previous versions have allowed basic usage of PostGIS's spatial types via built-in Npgsql types such as `NpgsqlPoint`, `NpgsqlLineString`, etc. These types were limited in many ways, and no operation translation was supported. If you want to calculate, say, the distance between two points, you had to drop down to raw SQL.
+
+No more! Thanks to a new plugin infrastructure, the EF Core provider now has full-class support for PostGIS. You can now use the [NetTopologySuite](https://github.com/NetTopologySuite/NetTopologySuite) spatial library to map PostGIS types - NetTopologySuite's types are more complete, and best of all, the provider knows how to translate its operations to SQL. This allows you to write the following code:
+
+```csharp
+var nearbyCities = context.Cities.Where(c => c.Location.Distance(somePoint) < 100);
+```
+
+See [the full documentation for more information](../mapping/nts.md).
+
+Thanks to [@YohDeadfall](https://github.com/YohDeadfall) for implementing support for this at the ADO level.
+
+### Full text search
+
+PostgreSQL has a powerful feature for efficient natural-language search across multiple columns and tables, [see the PostgreSQL docs for more info](https://www.postgresql.org/docs/current/static/textsearch.html). The EF Core provider now supports full-text search, allowing you to use .NET functions in your LINQ queries which will get translated to efficient PostgreSQL natural-language search queries.
+
+Read [the full documentation for more information](../mapping/full-text-search.md).
+
+Many thanks to [@rwasef1830](https://github.com/rwasef1830) for contributing this feature.
+
+### NodaTime date/time support
+
+[NodaTime](https://nodatime.org) is a powerful alternative to .NET's built-in date/time types, such as `DateTime`. The built-in types are flawed in many ways: they have problematic support for timezones, don't have a date-only or time-only types, and promote problematic programming but not making the right distinctions. If your application handles dates and times in anything but the most basic way, you should seriously consider using NodaTime. To learn more read [this blog post by Jon Skeet](https://blog.nodatime.org/2011/08/what-wrong-with-datetime-anyway.html).
+
+Thanks to a new plugin infrastructure, it is now possible to set up the EF Core provider to use NodaTime's types instead of the built-in .NET ones; instead of having `DateTime` properties on your entities, you can now have [Instant](https://nodatime.org/2.2.x/userguide/core-types) properties instead.
+
+See [the full documentation for more information](../mapping/nodatime.md).
+
+### PostgreSQL 10 IDENTITY columns
+
+PostgreSQL 10 introduced a new IDENTITY column as an alternative to traditional SERIAL columns, and these are now supported by the EF Core provider. IDENTITY columns conform to the SQL standard and are in general safer than SERIAL columns, [read this blog post for more info](https://docs.microsoft.com/ef/core/what-is-new/ef-core-2.1). It's recommended that all new projects use IDENTITY, but Npgsql even provides seamless migration of your existing SERIAL-based model!.
+
+Read [the full documentation for more information](../modeling/generated-properties.md).
+
+### Enum support
+
+It is now possible to map your CLR enums to [native PostgreSQL enums](https://www.postgresql.org/docs/current/static/datatype-enum.html). This is a unique PostgreSQL feature that provides the best of both worlds: the enum is internally stored in the database as a number (minimal storage), but is handled like a string (more usable, no need to remember numeric values) and has type safety.
+
+See [the full documentation for more information](../mapping/enum.md).
+
+### Range support
+
+PostgreSQL supports [native range types](https://www.postgresql.org/docs/current/static/rangetypes.html), which allow you to represent ranges of dates, ints and other data types in a single column. You can then efficiently perform queries on these types from LINQ, e.g. select all rows where a given date falls in the row's date range.
+
+See [the full documentation for more information](../mapping/range.md).
+
+Many thanks to [@austindrenski](https://github.com/austindrenski) for contributing the operation translations.
+
+### Other notable features
+
+* Several improvements have been made to the way arrays are mapped. For example, you can now map `List` to PostgreSQL array (previously only `T[]` was supported) ([#392](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/392)). In addition, change tracking now works for arrays, so EF Core will automatically detect when you change an element's array and will update the corresponding database column when saving.
+* PostgreSQL's built-in range types can now be mapped ([#63](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/63)), head over to the [PostgreSQL docs](https://www.postgresql.org/docs/current/static/rangetypes.html) to find out more about range types. Note that user-defined range types are *not* supported, if you're interested let us know at [#329](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/329).
+* Properties of type `char` are now supported and will be mapped to `character(1)` in PostgreSQL ([#374](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/374)).
+* Identifiers in generated SQL will only be quoted if needed ([#327](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/327)). This should make it much easier to read.
+* You can now use client certificate authentication and provide a server certificate validation callback ([#270](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/270)). See [the doc for usage instructions](http://www.npgsql.org/efcore/misc.html#certificate-authentication).
+* Added support for PostgreSQL 10 sequences with type `int` and `smallint` ([#301](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/301)).
+* You can now specify the [tablespace](https://www.postgresql.org/docs/current/static/manage-ag-tablespaces.html) when creating your databases ([#332](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/332)).
+
+Here's the [full list of issues](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/milestone/8?closed=1). Please report any problems on .
+
+## Breaking changes
+
+> [!CAUTION]
+> The provider's classes have been moved from the namespace `Microsoft.EntityFrameworkCore` to `Npgsql.EntityFrameworkCore.PostgreSQL`. As a result, any migrations already generated in your project (as well as the mode snapshot) will have to be manually updated to use the new namespace. You will need to add `using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata` to all the relevant files.
+
+* Columns of type `timestamp with time zone`/`timestamptz` will now be scaffolded as `DateTime` properties, and not `DateTimeOffset` properties. The general use of `timestamp with time zone`/`timestamptz` is discouraged (this type does *not* store the timezone in the database), consider using `timestamp without time zone`/`timestamp` instead.
+* If you're specifying index methods with `ForNpgsqlHasMethod()`, then you will have to fix migrations which generate those indexes. In these migrations, you will find code such as `.Annotation("Npgsql:Npgsql:IndexMethod", "gin")`. You must remove the extra `Npgsql:`, leaving `.Annotation("Npgsql:IndexMethod", "gin")`.
+* Specifying versions when specifying PostgreSQL extensions on your model is no longer supported - this was a very rarely-used feature which interfered with extension scaffolding.
+* If you're still referencing the nuget package Npgsql.EntityFrameworkCore.PostgreSQL.Design, please remove it - it's no longer needed or up to date.
+
+## Contributors
+
+Thank you very much to the following people who have contributed to the individual 2.1.x. releases.
+
+### [Milestone 2.1.2](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.2)
+
+Contributor | Assigned issues
+---------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [6](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.2+is%3Aclosed+assignee%3Aroji)
+[@austindrenski](https://github.com/austindrenski) | [3](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.2+is%3Aclosed+assignee%3Aaustindrenski)
+[@rwasef1830](https://github.com/rwasef1830) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.2+is%3Aclosed+assignee%3Arwasef1830)
+
+### [Milestone 2.1.11](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.11)
+
+Contributor | Assigned issues
+---------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.11+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 2.1.1.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.1.1)
+
+Contributor | Assigned issues
+---------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [4](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.1.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 2.1.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.1)
+
+Contributor | Assigned issues
+---------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [9](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 2.1.0](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.0)
+
+| Contributor | Assigned issues
+| -------------------------------------------------- | ----------------:|
+| [@roji](https://github.com/roji) | [24](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed+assignee%3Aroji)
+| [@austindrenski](https://github.com/austindrenski) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed+assignee%3Aaustindrenski)
+| [@rwasef1830](https://github.com/rwasef1830) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed+assignee%3Arwasef1830)
diff --git a/docs/release-notes/2.2.md b/docs/release-notes/2.2.md
new file mode 100644
index 0000000000..89de0f847b
--- /dev/null
+++ b/docs/release-notes/2.2.md
@@ -0,0 +1,81 @@
+# 2.2 Release Notes
+
+Version 2.2.0 of the Npgsql Entity Framework Core provider has been released and is available on nuget. This version works with [version 2.2.0 of Entity Framework Core](https://docs.microsoft.com/ef/core/what-is-new/ef-core-2.2), and contains some new Npgsql features as well.
+
+This release was result of hard work by [@roji](https://github.com/roji/), [@austindrenski](https://github.com/austindrenski), [@yohdeadfall](https://github.com/yohdeadfall) and [@khellang](https://github.com/khellang).
+
+## New Features
+
+Aside from general EF Core features new in 2.2.0, the Npgsql EF Core provider contains the following major new features:
+
+### PostgreSQL 11 covering indexes
+
+PostgreSQL 11 introduced [covering indexes feature](https://paquier.xyz/postgresql-2/postgres-11-covering-indexes), which allow you to include "non-key" columns in your indexes. This allows you to perform index-only scans and can provide a significant performance boost. Support has been added in ([#697](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/697)):
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder builder)
+ => modelBuilder.Entity()
+ .ForNpgsqlHasIndex(b => b.Id)
+ .ForNpgsqlInclude(b => b.Name);
+```
+
+This will create an index for searching on `Id`, but containing also the column `Name`, so that reading the latter will not involve accessing the table. [See the documentation for more details](../modeling/indexes.md).
+
+Thanks to [@khellang](https://github.com/khellang) for contributing this!
+
+### PostgreSQL user-defined ranges
+
+The provider already supported [PostgreSQL range types](https://www.postgresql.org/docs/current/rangetypes.html), but prior to 2.2 that support was limited to the built-in range types which come with PostgreSQL. [#329](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/329) extends that support to range types which you define:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder builder)
+ => builder.UseNpgsql("...", b => b.MapRange("floatrange"));
+
+protected override void OnModelCreating(ModelBuilder builder)
+ => builder.ForNpgsqlHasRange("floatrange", "real");
+```
+
+This will make the provider create a PostgreSQL range called `floatrange`, over the PostgreSQL type `real`. Any property with type `NpgsqlRange` will be seamlessly mapped to it.
+
+[See the documentation for more details](../mapping/range.md).
+
+### Seeding for Npgsql-specific types
+
+When using some Npgsql-specific types, it wasn't possible to seed values for those types. With EF Core support for seeding any type, [#667](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/667) allows seeding values for network, bit and range types (more are coming).
+
+### PostgreSQL index operator classes
+
+PostgreSQL allows you to specify [operator classes on your indexes](https://www.postgresql.org/docs/current/indexes-opclass.html), to allow tweaking how the index should work. [#481](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/481) adds support for managing these. [See the documentation for more details](../modeling/indexes.md).
+
+Thanks to [@khellang](https://github.com/khellang) for contributing this!
+
+### Other features
+
+* Various issues with enum and range types were fixed, including upper/lower case, quoting and schema management.
+* Many new SQL translations were added, so more of your LINQ expressions can run in the database. We'll be working on our documentation to make these more discoverable.
+
+The full list of issues for this release is [available here](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues?q=milestone%3A2.2.0+is%3Aclosed&utf8=%E2%9C%93).
+
+## Contributors
+
+Thank you very much to the following people who have contributed to the individual 2.2.x. releases.
+
+### [Milestone 2.2.6](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.6)
+
+Contributor | Assigned issues
+------------------------------------------------ | ----------------:|
+[@roji](https://github.com/roji) |[5](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.6+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 2.2.4](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.4)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [3](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.4+is%3Aclosed+assignee%3Aroji)
+[@austindrenski](https://github.com/austindrenski) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.4+is%3Aclosed+assignee%3Aaustindrenski)
+
+### [Milestone 2.2.0](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.0)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@austindrenski](https://github.com/austindrenski) | [15](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.0+is%3Aclosed+assignee%3Aaustindrenski)
+[@roji](https://github.com/roji) | [8](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A2.2.0+is%3Aclosed+assignee%3Aroji)
diff --git a/docs/release-notes/3.1.md b/docs/release-notes/3.1.md
new file mode 100644
index 0000000000..2c39309a3d
--- /dev/null
+++ b/docs/release-notes/3.1.md
@@ -0,0 +1,125 @@
+# 3.1 Release Notes
+
+Version 3.1 of the Npgsql Entity Framework Core provider has been released and is available on nuget. This version works with [version 3.1 of Entity Framework Core](https://docs.microsoft.com/ef/core/what-is-new/ef-core-3.x), and brings new Npgsql features in addition to the general EF Core changes.
+
+> [!CAUTION]
+> Use these versions with care and do not deploy to production without thorough testing. Read the breaking changes section below.
+
+The full list of issues for this release is [available here](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/milestone/20?closed=1).
+
+## New Features
+
+Aside from general EF Core features new in 3.1, the Npgsql EF Core provider contains the following major new features:
+
+* It is now possible to map POCOs to JSON columns and query them, [see the docs for more info](../mapping/json.md) ([#981](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/981))
+* PostgreSQL identity columns are now the default - see breaking changes below) ([#804](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/804))
+* Sequence options can now be managed on identity columns ([#819](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/819))
+* Support has been added for the upcoming [PostgreSQL 12 generated columns feature](https://www.postgresql.org/docs/12/ddl-generated-columns.html) ([#939](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/939))
+* A plugin is now available to automatically make all your tables and columns be snake_case! See [EFCore.NamingConventions](https://github.com/efcore/EFCore.NamingConventions).
+* Index sort options (ascending/descending, null sort order...) can now be specified ([#326](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/326))
+* Indexes can now be created concurrently ([#967](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/967))
+* Views are now reverse-engineered ([#878](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/878))
+* Array value converters help mapping with PostgreSQL arrays (e.g. map enum arrays to integer arrays) ([#1031](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/1031)).
+
+## Breaking changes
+
+### Default value generation strategy is now IDENTITY
+
+> [!CAUTION]
+> This is a major change, and upgrading to 3.1 with an existing database will cause a non-trivial schema migration to be generated. Read the following carefully.
+
+The default value generation strategy has changed from the older SERIAL columns to the newer IDENTITY columns, introduced in PostgreSQL 10.
+
+When producing a migration with 3.1, the Npgsql provider will attempt to automatically generate SQL to alter your tables and convert serial columns to identity ones. This is a sensitive, one-time migration operation that should be done with care, and carefully tested before deployment to production.
+
+If you wish to opt out of using IDENTITY columns and continue using SERIAL columns, set the following on your model:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+ => modelBuilder.UseSerialColumns();
+```
+
+If you are using a PostgreSQL version older than 10, setting the compatibility mode is a better way to switch the default back to SERIAL columns:
+
+```csharp
+protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ => optionsBuilder.UseNpgsql("...", o => o.SetPostgresVersion(9, 6));
+```
+
+More information is available in [the page about generated properties](../modeling/generated-properties.md).
+
+## Contributors
+
+Thank you very much to the following people who have contributed to the individual 3.x releases.
+
+### [Milestone 3.1.11](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A3.1.11)
+
+| Contributor | Assigned issues |
+| -------------------------------- | -----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A3.1.11+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 3.1.7](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.7)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [4](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.7+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.1.4](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.4)
+
+Contributor | Assigned issues
+-------------------------------------------------- |-----------------:|
+[@roji](https://github.com/roji) | [4](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.4+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.1.3](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.3)
+
+Contributor | Assigned issues
+-------------------------------------------------- |-----------------:|
+[@roji](https://github.com/roji) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.3+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.1.2](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.2)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [3](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.2+is%3Aclosed+assignee%3Aroji)
+[@grzybsonssg](https://github.com/grzybsonssg) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.2+is%3Aclosed+assignee%3Agrzybsonssg)
+
+### [Milestone 3.1.1.2](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.1.2)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.1.2+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.1.1.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.1.1)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.1.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.1.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.1)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [6](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.1.0](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.0)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [15](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.0+is%3Aclosed+assignee%3Aroji)
+[@austindrenski](https://github.com/austindrenski) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.0+is%3Aclosed+assignee%3Aaustindrenski)
+[@ins0mniaque](https://github.com/ins0mniaque) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.0+is%3Aclosed+assignee%3Ains0mniaque)
+[@MarioPrabowo](https://github.com/MarioPrabowo) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.1.0+is%3Aclosed+assignee%3AMarioPrabowo)
+
+### [Milestone 3.0.1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.0.1)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.0.1+is%3Aclosed+assignee%3Aroji)
+
+### [Milestone 3.0.0](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.0.0)
+
+Contributor | Assigned issues
+-------------------------------------------------- | ----------------:|
+[@roji](https://github.com/roji) | [25](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.0.0+is%3Aclosed+assignee%3Aroji)
+[@austindrenski](https://github.com/austindrenski) | [2](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.0.0+is%3Aclosed+assignee%3Aaustindrenski)
+[@YohDeadfall](https://github.com/YohDeadfall) | [1](https://github.com/npgsql/EFCore.PG/issues?q=is%3Aissue+milestone%3A3.0.0+is%3Aclosed+assignee%3AYohDeadfall)
diff --git a/docs/release-notes/5.0.md b/docs/release-notes/5.0.md
new file mode 100644
index 0000000000..4e8bf9513a
--- /dev/null
+++ b/docs/release-notes/5.0.md
@@ -0,0 +1,112 @@
+# 5.0 Release Notes
+
+Version 5.0 of the Npgsql Entity Framework Core provider has been released and is available on nuget. This version works with [version 5.0 of Entity Framework Core](https://docs.microsoft.com/ef/core/what-is-new/ef-core-5.0/whatsnew), and brings new Npgsql features in addition to the general EF Core changes.
+
+## New Features
+
+Aside from general EF Core features new in 5.0, here is a non-exhaustive list of features added in the Npgsql EF Core provider:
+
+* Full support for PostgreSQL collations. [See the docs](http://www.npgsql.org/efcore/misc/collations-and-case-sensitivity.html?tabs=data-annotations) for more info.
+* It is now much easier to create indexes for full-text search ([#1097](https://github.com/npgsql/efcore.pg/issues/1097), [#1253](https://github.com/npgsql/efcore.pg/issues/1253)). [See the docs](../mapping/full-text-search.md) for more info.
+* Sequences are now automatically updated after seeding data to avoid duplicate values ([#367](https://github.com/npgsql/efcore.pg/issues/367)).
+* [The `[JsonPropertyName]` attribute](https://docs.microsoft.com/dotnet/api/system.text.json.serialization.jsonpropertynameattribute) is now respected when mapping to JSON ([#1419](https://github.com/npgsql/efcore.pg/issues/1419)).
+* Improved support for PostgreSQL arrays:
+ * Mapping `List` is now fully supported ([#395](https://github.com/npgsql/efcore.pg/issues/395)).
+ * Mapping arrays of nullable value types (e.g. `int?[]`) is now supported ([#1025](https://github.com/npgsql/efcore.pg/issues/1025)).
+* Query translations:
+ * [Precise, exhaustive documentation](http://www.npgsql.org/efcore/mapping/translations.html) has been added on which functions can be used in LINQ queries.
+ * `Contains` over arrays now uses indexes in various scenarios, improving performance ([#1372](https://github.com/npgsql/efcore.pg/issues/1372)).
+ * Various members of [TimeSpan](https://docs.microsoft.com/dotnet/api/system.timespan?view=netcore-3.1) are now translated and can be used in queries ([#328](https://github.com/npgsql/efcore.pg/issues/328)).
+ * Support for [unaccent](https://www.postgresql.org/docs/current/unaccent.html) ([#1530](https://github.com/npgsql/efcore.pg/issues/1530)). Thanks [@cloudlucky](https://github.com/cloudlucky).
+ * Various translations over byte array properties have been added ([#1225](https://github.com/npgsql/efcore.pg/issues/1225), [#1226](https://github.com/npgsql/efcore.pg/issues/1226).
+* Improved null semantics for PostgreSQL-specific operations results in tighter and more efficient SQL ([#1142](https://github.com/npgsql/efcore.pg/issues/1142)).
+* Better support for NodaTime:
+ * It is now possible to map NodaTime `Duration` to PostgreSQL `interval`, previously only `Period` could be mapped ([#1567](https://github.com/npgsql/efcore.pg/issues/1567).
+ * Some additional arithmetic operation are now translated ([#1565](https://github.com/npgsql/efcore.pg/issues/1565)).
+* It is now possible to add labels to existing enums (but not remove or modify existing ones). The provider will generate the appropriate migrations ([#1182](https://github.com/npgsql/efcore.pg/issues/1182)).
+
+The full list of issues for this release is [available here](https://github.com/npgsql/efcore.pg/milestone/24?closed=1).
+
+## Breaking changes
+
+Please consult the EF Core 5.0 [breaking changes page](https://docs.microsoft.com/ef/core/what-is-new/ef-core-5.0/breaking-changes) as well - the below lists only changes specific to the Npgsql provider.
+
+### Computed columns must now explicitly be configured as stored ([#1336](https://github.com/npgsql/efcore.pg/issues/1336))
+
+Version 3.1 of the provider added support for [PostgreSQL generated columns](https://www.postgresql.org/docs/current/ddl-generated-columns.html) ([#939](https://github.com/npgsql/efcore.pg/issues/939)), referred to as [computed columns in EF Core](https://docs.microsoft.com/ef/core/modeling/generated-properties?tabs=data-annotations#computed-columns). EF Core 5.0 adds support for specifying whether a computed column is *virtual* (computed when fetched), or *stored* (persisted on disk and computed when modified). Aligning with most databases, EF Core by default creates virtual computed columns, but these are currently unsupported by PostgreSQL.
+
+As a result, you must explicitly specify on all computed columns that they are stored:
+
+```csharp
+modelBuilder.Entity()
+ .Property(p => p.FullName)
+ .HasComputedColumnSql("...", stored: true);
+```
+
+If you have existing migrations which were created with previous versions of EF Core, the column definitions in those also need to be fixed up with `stored: true`.
+
+### IsCreatedConcurrently defaults to true ([#1212](https://github.com/npgsql/efcore.pg/issues/1212))
+
+Previously, when `IsCreatedConcurrently` was used to configure an index without parameters, the default was `false` - this has changed to `true`. Note that indexes are never configured for for concurrent creation unless `IsCreatedConcurrently` is specified.
+
+## Contributors
+
+A big thank you to all the following people who contributed to the 5.0 release!
+
+### [Milestone 5.0.10](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.10)
+
+| Contributor | Assigned issues |
+| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [3](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.10+is%3Aclosed+assignee%3Aroji) |
+| [@dmitrynovik](https://github.com/dmitrynovik) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.10+is%3Aclosed+assignee%3Admitrynovik) |
+
+### [Milestone 5.0.7](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.7)
+
+| Contributor | Assigned issues |
+| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.7+is%3Aclosed+assignee%3Aroji) |
+| [@nathan-c](https://github.com/nathan-c) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.7+is%3Aclosed+assignee%3Anathan-c) |
+
+### [Milestone 5.0.6](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.6)
+
+| Contributor | Assigned issues |
+| ------------------------------------ | ------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [2](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.6+is%3Aclosed+assignee%3Aroji) |
+| [@kakone](https://github.com/kakone) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.6+is%3Aclosed+assignee%3Akakone) |
+
+### [Milestone 5.0.5.1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.5.1)
+
+| Contributor | Assigned issues |
+| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------:|
+| [@fsibilla](https://github.com/fsibilla) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.5.1+is%3Aclosed+assignee%3Afsibilla) |
+| [@roji](https://github.com/roji) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.5.1+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 5.0.5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.5)
+
+| Contributor | Assigned issues |
+| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [8](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.5+is%3Aclosed+assignee%3Aroji) |
+| [@DanielAdolfsson](https://github.com/DanielAdolfsson) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.5+is%3Aclosed+assignee%3ADanielAdolfsson) |
+
+### [Milestone 5.0.2](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.2)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [6](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.2+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 5.0.1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.1)
+
+| Contributor | Assigned issues |
+| ------------------------------------ | ------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [4](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.1+is%3Aclosed+assignee%3Aroji) |
+| [@akilin](https://github.com/akilin) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.1+is%3Aclosed+assignee%3Aakilin) |
+
+### [Milestone 5.0.0](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.0)
+
+| Contributor | Assigned issues |
+| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [50](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.0+is%3Aclosed+assignee%3Aroji) |
+| [@artfulsage](https://github.com/artfulsage) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.0+is%3Aclosed+assignee%3Aartfulsage) |
+| [@cloudlucky](https://github.com/cloudlucky) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.0+is%3Aclosed+assignee%3Acloudlucky) |
+| [@plamen-i](https://github.com/plamen-i) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.0+is%3Aclosed+assignee%3Aplamen-i) |
+| [@Quogu](https://github.com/Quogu) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A5.0.0+is%3Aclosed+assignee%3AQuogu) |
diff --git a/docs/release-notes/6.0.md b/docs/release-notes/6.0.md
new file mode 100644
index 0000000000..d2f457308f
--- /dev/null
+++ b/docs/release-notes/6.0.md
@@ -0,0 +1,261 @@
+# 6.0 Release Notes
+
+The release candidate of Npgsql Entity Framework Core provider version 6.0 has been released and is available on nuget. This version works with [version 6.0 of Entity Framework Core](https://docs.microsoft.com/ef/core/what-is-new/ef-core-6.0/whatsnew), and brings new Npgsql features in addition to the general EF Core changes.
+
+Npgsql 6.0 brings some major breaking changes and is not a simple in-place upgrade. Carefully read the breaking change notes below and upgrade with care.
+
+## New features
+
+### Timestamp rationalization and improvements
+
+Support for `timestamp with time zone` and `timestamp without time zone` has been rationalized and simplified, and aligned with PostgreSQL best practices. In particular, the "UTC everywhere" pattern is much better supported via the PostgreSQL `timestamp with time zone` type, which is the recommended way to handle timestamps. A detailed explanation is available in [this blog post](https://www.roji.org/postgresql-dotnet-timestamp-mapping), below is a summary of the main improvements.
+
+* UTC timestamps have been cleanly separated from non-UTC timestamps, aligning with the PostgreSQL types. The former are represented by `timestamp with time zone` and DateTime with Kind UTC, the latter by `timestamp without time zone` and DateTime with Kind Local or Unspecified. It is recommended to use UTC timestamps where possible.
+* Npgsql no longer performs any implicit timezone conversions when reading or writing any timestamp value - the value in the database is what you get, and the machine timezone no longer plays any role when reading/writing values.
+* Npgsql no longer supports date/time representations which cannot be fully round-tripped to the database. If it can't be fully stored as-is, you can't write it.
+* A compatibility switch enables opting out of the new behavior, to maintain backwards compatibility.
+
+This change introduces significant breaking changes (see below), although a compatibility flag can be used to opt out and revert to the previous behavior.
+
+Other date/time improvements include:
+
+* Support for the new [.NET DateOnly and TimeOnly types](https://devblogs.microsoft.com/dotnet/date-time-and-time-zone-enhancements-in-net-6/).
+* Most [DateTimeOffset](https://docs.microsoft.com/dotnet/api/system.datetimeoffset) members and methods are now translated.
+* Many NodaTime translations have been added for [ZonedDateTime](https://nodatime.org/3.0.x/api/NodaTime.ZonedDateTime.html), [Period](https://nodatime.org/3.0.x/api/NodaTime.Period.html), [DateInterval](https://nodatime.org/3.0.x/api/NodaTime.DateInterval.html) and others.
+* PostgreSQL `tstzrange` is now mapped to NodaTime [Interval](https://nodatime.org/3.0.x/api/NodaTime.Interval.html), and PostgreSQL `daterange` is now mapped to NodaTime [DateInterval](https://nodatime.org/3.0.x/api/NodaTime.DateInterval.html). Most methods on these types are translated ([#1998](https://github.com/npgsql/efcore.pg/issues/1998), [#2059](https://github.com/npgsql/efcore.pg/issues/2059)).
+
+### Other new features
+
+* The provider is now fully annotated for nullable reference types.
+* Full support for the PostgreSQL 14 [multirange type](https://www.postgresql.org/docs/14/rangetypes.html), mapped to arrays or lists of `NpgsqlRange` ([#1963](https://github.com/npgsql/efcore.pg/issues/1963)). Includes translation of all major operators and functions, [see the updated docs](../mapping/range.md).
+* Support for PostgreSQL 14 [column compression methods](https://paquier.xyz/postgresql-2/postgres-14-table-compression/) ([#2062](https://github.com/npgsql/efcore.pg/issues/2062)).
+* Support for the PostgreSQL [ltree](https://www.postgresql.org/docs/current/ltree.html) type, which represents labels of data stored in a hierarchical tree-like structure. Requires PostgreSQL 13 and above.
+* Multiple spatial translations have been added for NetTopologySuite ([DistanceKnn, <->](https://github.com/npgsql/efcore.pg/issues/1827), [ST_Force2D](https://github.com/npgsql/efcore.pg/issues/1917), [ST_Distance and ST_DWithin with spheriod](https://github.com/npgsql/efcore.pg/issues/1638)).
+* More translations and better type inference for arrays ([#2026](https://github.com/npgsql/efcore.pg/issues/2026)).
+
+The full list of issues for this release is [available here](https://github.com/npgsql/efcore.pg/milestone/34?closed=1).
+
+## Breaking changes
+
+### Major changes to timestamp mapping
+
+> [!NOTE]
+> It is possible to opt out of these changes to maintain backwards compatibility, see below.
+
+#### Quick summary
+
+* In many cases, it makes sense to store UTC timestamps in the database. To do this, migrate your `timestamp without time zone` columns to `timestamp with time zone` ([see migration notes below](#migrating-columns-from-timestamp-to-timestamptz)), and always use either DateTime with Kind=Utc or DateTimeOffset with offset 0.
+ * If using NodaTime (recommended), use either [Instant](https://nodatime.org/3.0.x/api/NodaTime.Instant.html) or [ZonedDateTime](https://nodatime.org/3.0.x/api/NodaTime.ZonedDateTime.html) with time zone UTC.
+* To store non-UTC timestamps, use DateTime with Kind=Unspecified and [add explicit configuration](https://docs.microsoft.com/ef/core/modeling/entity-properties#column-data-types) to your properties to be `timestamp without time zone`.
+ * If using NodaTime (recommended), use [LocalDateTime](https://nodatime.org/3.0.x/api/NodaTime.LocalDateTime.html) (no explicit column configuration is required).
+
+#### Detailed notes
+
+The below notes will use the PostgreSQL aliases `timestamptz` to refer to `timestamp with time zone`, and `timestamp` to refer to `timestamp without time zone`. Note that `timestamp with time zone` represents a UTC timestamp and does **not** store a timezone in the database.
+
+* DateTime properties now map to `timestamptz` by default, instead of to `timestamp`; this follows the recommended practice of storing UTC timestamps by default, but will cause the first migration to change your column type.
+ * If the intention is to store point-in-time or UTC timestamps, it's recommended to allow the migration to occur ([see migration notes below](#migrating-columns-from-timestamp-to-timestamptz)).
+ * If the column really should store non-UTC timestamps (local or unspecified), [explicitly set the column type back to `timestamp`](https://docs.microsoft.com/ef/core/modeling/entity-properties#column-data-types). This is usually discouraged, but can be a temporary solution before transitioning to `timestamptz`.
+* It is no longer possible to write DateTime with Kinds Local or Unspecified to `timestamptz` properties (which are the default for DateTime). Previously, Npgsql allowed writing those, performing timezone conversions from local to UTC. To write to `timestamptz`, provide a UTC DateTime. Similarly, it is no longer possible to write DateTime with Kind UTC to a `timestamp` column.
+* `timestamptz` values are now read back as DateTime with Kind=UTC, without any conversions; these were previously returned as local DateTime, converted to the local machine's timezone. When reading `timestamptz` values as [DateTimeOffset](https://docs.microsoft.com/dotnet/api/system.datetimeoffset), UTC values (offset 0) are always returned.
+* It is no longer possible to write [DateTimeOffset](https://docs.microsoft.com/dotnet/api/system.datetimeoffset) with offsets other than 0 (UTC), since these cannot be represented in PostgreSQL. These were previously implicitly converted to UTC before sending.
+
+See the [Npgsql ADO.NET docs](/doc/release-notes/5.0.html) for additional lower-level changes to timestamp handling.
+
+#### NodaTime changes
+
+* Properties with type [Instant](https://nodatime.org/3.0.x/api/NodaTime.Instant.html) are now mapped to `timestamptz` columns, and not to `timestamp`, since they represent a universally agreed-upon point in time. This follows the recommended practice, but will cause the first migration to change your column type.
+ * If the intention is to store point-in-time or UTC timestamps, it's recommended to allow the migration to occur ([see migration notes below](#migrating-columns-from-timestamp-to-timestamptz)).
+ * If the column really should store non-UTC timestamps (local or unspecified), change the property's type to [LocalDateTime](https://nodatime.org/3.0.x/api/NodaTime.LocalDateTime.html) instead; this will maintain the mapping to `timestamp`. This is usually discouraged, but can be a temporary solution before transitioning to `timestamptz`.
+* When reading `timestamptz` as [ZonedDateTime](https://nodatime.org/3.0.x/api/NodaTime.ZonedDateTime.html) or [OffsetDateTime](https://nodatime.org/3.0.x/api/NodaTime.OffsetDateTime.html), UTC values are always returned. Previously, local values based on the PostgreSQL `TimeZone` parameter were returned.
+
+#### Migrating columns from timestamp to timestamptz
+
+As a result of the above changes, the first migration created after upgrading to 6.0 will alter the columns for all DateTime and Instant properties from `timestamp` to `timestamptz`. If these columns are meant to store point-in-time or UTC timestamps (the recommended practice), then it's best to let this migration proceed; but care must be taken.
+
+As a starting point, let's assume your existing `timestamp` column has the timestamp `2020-01-01 12:00:00`:
+
+```sql
+SELECT "CreatedOn", pg_typeof("CreatedOn") AS type FROM "Blogs";
+```
+
+Results in:
+
+```output
+ CreatedOn | type
+---------------------+-----------------------------
+ 2020-01-01 12:00:00 | timestamp without time zone
+```
+
+The migration generated by version 6.0 will cause the following SQL to be generated:
+
+```sql
+ALTER TABLE "Blogs" ALTER COLUMN "CreatedOn" TYPE timestamp with time zone;
+```
+
+When converting the `timestamp without time zone` column to `timestamp with time zone`, PostgreSQL will assume that existing values are local timestamps, and will convert them to UTC based on the `TimeZone` parameter. Performing the above query will result in something like:
+
+```output
+ CreatedOn | type
+------------------------+--------------------------
+ 2020-01-01 12:00:00+02 | timestamp with time zone
+```
+
+This means that your new `timestamptz` column now contains 10:00 UTC, which is probably not what you want: if the original values were in fact UTC values, you need them to be preserved as-is, changing only the column type. To do this, edit your migration and add the following to the top of your migration's Up and Down methods:
+
+```csharp
+migrationBuilder.Sql("SET TimeZone='UTC';");
+```
+
+This will ensure that no time zone conversions will be applied when converting the columns:
+
+```output
+ CreatedOn | type
+------------------------+--------------------------
+ 2020-01-01 14:00:00+02 | timestamp with time zone
+```
+
+#### Changing timestamp seed data
+
+When switching from `timestamp without time zone` to `timezone with time zone`, you may have have non-UTC timestamp literals in your seeding configuration:
+
+```csharp
+modelBuilder.Entity().HasData(new Blog { Id = 1, Timestamp = new DateTime(2020, 1, 1, 0, 0, 0) });
+```
+
+If so, you'll have to change these to be UTC. In addition, all migrations code since the change must be modified in the same way, to only seed UTC DateTime into the column; the model snapshot should be changed as well.
+
+#### Opting out of the new timestamp mapping logic
+
+The changes described above are far-reaching, and may break applications in various ways. You can upgrade to version 6.0 but opt out of the new mapping by enabling the `Npgsql.EnableLegacyTimestampBehavior` [AppContext switch](https://docs.microsoft.com/en-us/dotnet/api/system.appcontext?view=net-5.0). To do this and revert to the legacy timestamp behavior, add the following to your context's constructor, before any Npgsql or EF Core operations are invoked:
+
+```csharp
+AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
+```
+
+### NodaTime: tstzrange and daterange are mapped to Interval and DateInterval by default
+
+When using NodaTime, PostgreSQL `tstzrange` columns are scaffolded as [Interval](https://nodatime.org/3.0.x/api/NodaTime.Interval.html) properties instead of `NpgsqlRange` ([#4070](https://github.com/npgsql/npgsql/issues/4070)), and `daterange` columns are scaffolded as [DateInterval](https://nodatime.org/3.0.x/api/NodaTime.DateInterval.html) properties of `NpgsqlRange` ([#1998](https://github.com/npgsql/efcore.pg/issues/1998)).
+
+### Date/time min/max values are now converted to PostgreSQL infinity values by default
+
+PostgreSQL has special `infinity` and `-infinity` values for timestamps and dates, which are later and earlier than other value. Npgsql has supported mapping `DateTime.MaxValue` and `MinValue` to these infinity values via an `Convert Infinity DateTime` connection string parameter, which was disabled by default. This behavior is now on by default, since `DateTime.MaxValue` and `MinValue` are very rarely used as actual timestamps/dates, and the `Convert Infinity DateTime` parameter has been removed. To disable infinity conversions, add the following at the start of your application:
+
+```csharp
+AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
+```
+
+[See the date/time documentation](/doc/types/datetime.html#infinity-values) for more details.
+
+### Value converters for array/list properties need to use a special new API
+
+Previously, it was possible to configure value converters for array/list properties with the general EF Core API:
+
+```csharp
+modelBuilder.Entity.Property(e => e.ValueConvertedArray)
+ .HasConversion(w => w.Select(x => x.Value).ToArray(), v => v.Select(x => new IntWrapper(x)).ToArray());
+```
+
+This is no longer possible and will cause an exception to be thrown. Instead, use the new `HasPostgresArrayConversion` API, providing conversion lambdas for the array's *elements*:
+
+```csharp
+modelBuilder.Entity.Property(e => e.ValueConvertedArray)
+ .HasPostgresArrayConversion(w => w.Value, v => new IntWrapper(v));
+```
+
+### Arrays/lists over ranges are mapped to PG14 multiranges
+
+PostgreSQL 14 introduced [a new multirange type](https://www.postgresql.org/docs/14/rangetypes.html), which is very similar to an array of ranges but supports various range-related operations efficiently. The provider now maps arrays and lists of `NpgsqlRange` to these new types by default. To map them to old-style arrays over ranges in PostgreSQL, [configure the column type explicitly](https://docs.microsoft.com/ef/core/modeling/entity-properties#column-data-types):
+
+### [Data Annotations](#tab/annotations)
+
+```csharp
+[Column(TypeName = "int4range[]")]
+public NpgsqlRange[] SomeArrayOverIntNpgsqlRange { get; set;}
+```
+
+### [Fluent API](#tab/fluent-api)
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder
+ .Entity()
+ .Property(e => e.SomeArrayOverIntNpgsqlRange)
+ .HasColumnType("int4range[]");
+}
+```
+
+***
+
+### Trigrams and FuzzyStringMatch plugins are now built-in
+
+The Npgsql.EntityFrameworkCore.PostgreSQL.Trigrams and Npgsql.EntityFrameworkCore.PostgreSQL.FuzzyStringMatch plugins have been integrated into the main provider; as a result, there are no 6.0 versions of these nuget packages - simply remove the package references from your project when upgrading to 6.0.0.
+
+## Contributors
+
+A big thank you to all the following people who contributed to the 6.0 release!
+
+### [Milestone 6.0.8](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.8)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [3](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.8+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 6.0.7](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.7)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.7+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 6.0.6](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.6)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [2](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.6+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 6.0.5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.5)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.5+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 6.0.4](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.4)
+
+| Contributor | Assigned issues |
+| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [6](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.4+is%3Aclosed+assignee%3Aroji) |
+| [@kourosko](https://github.com/kourosko) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.4+is%3Aclosed+assignee%3Akourosko) |
+
+### [Milestone 6.0.3](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.3)
+
+| Contributor | Assigned issues |
+| -------------------------------------- | -------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [8](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.3+is%3Aclosed+assignee%3Aroji) |
+| [@rus-art](https://github.com/rus-art) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.3+is%3Aclosed+assignee%3Arus-art) |
+
+### [Milestone 6.0.2](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.2)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [4](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.2+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 6.0.1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.1)
+
+| Contributor | Assigned issues |
+| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [5](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.1+is%3Aclosed+assignee%3Aroji) |
+| [@Brar](https://github.com/Brar) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.1+is%3Aclosed+assignee%3ABrar) |
+| [@vonzshik](https://github.com/vonzshik) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.1+is%3Aclosed+assignee%3Avonzshik) |
+
+### [Milestone 6.0.0](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0)
+
+| Contributor | Assigned issues |
+| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [56](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3Aroji) |
+| [@vonzshik](https://github.com/vonzshik) | [2](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3Avonzshik) |
+| [@arontsang](https://github.com/arontsang) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3Aarontsang) |
+| [@Isitar](https://github.com/Isitar) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3AIsitar) |
+| [@kislovs](https://github.com/kislovs) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3Akislovs) |
+| [@pafrench](https://github.com/pafrench) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3Apafrench) |
+| [@tiborfsk](https://github.com/tiborfsk) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A6.0.0+is%3Aclosed+assignee%3Atiborfsk) |
diff --git a/docs/release-notes/7.0.md b/docs/release-notes/7.0.md
new file mode 100644
index 0000000000..c5bdb46ba2
--- /dev/null
+++ b/docs/release-notes/7.0.md
@@ -0,0 +1,139 @@
+# 7.0 Release Notes
+
+## New features
+
+### ExecuteUpdate and ExecuteDelete
+
+Support has been added for the new EF Core 7.0 `ExecuteUpdate` and `ExecuteDelete`, which allow expressing arbitrary, efficient updates via LINQ. See the EF [What's new section](https://learn.microsoft.com/ef/core/what-is-new/ef-core-7.0/whatsnew#executeupdate-and-executedelete-bulk-updates) for documentation.
+
+### Support for DbDataSource
+
+Npgsql 7.0 introduced , a major improvement to how database connections and configuration are managed in System.Data. enabled rich new configuration APIs, which are also available when using the Npgsql EF provider:
+
+```csharp
+// Create a data source with the configuration you want:
+var dataSourceBuilder = new NpgsqlDataSourceBuilder(builder.Configuration.GetConnectionString("MyContext"));
+dataSourceBuilder
+ .UseLoggerFactory(loggerFactory) // Configure ADO.NET logging
+ .UsePeriodicPasswordProvider(); // Automatically rotate the password periodically
+await using var dataSource = dataSourceBuilder.Build();
+
+// Pass your data source to the EF provider:
+builder.Services.AddDbContext(options => options.UseNpgsql(dataSource);
+```
+
+Note that the data source configuration works at the Npgsql ADO.NET layer, and is distinct from EF-level configuration. More improvements are planned in 8.0, to make data source usage more streamlined, especially around type mapping plugins, enums, etc.
+
+### Extensive support for aggregate function translation
+
+EF Core 7.0 added support for translating provider-specific aggregate functions, and EFCore.PG builds on top of that to translate most major aggregate functions that PostgreSQL supports. This unlocks support for:
+
+* **string_agg**: pack a column's values into a single string, with or without a delimiter.
+* **array_agg**: pack a column's values into a PostgreSQL array. This can help with efficient fetching of dependent values, avoiding the so-called "cartesian explosion" problem.
+* **Statistical functions**: standard deviation, variance and many others.
+* **Spatial functions**: ST_Union, ST_Collect, ST_Extent and ST_ConvexHull.
+* **JSON functions**: load values from the database as JSON documents with json_agg/jsonb_agg and json_object_agg/jsonb_object_agg.
+
+For the PostgreSQL documentation on aggregate functions, see [this page](https://www.postgresql.org/docs/current/functions-aggregate.html). The exact translations supported by the provider are documented in the [translations page](../mapping/translations.md#aggregate-functions).
+
+### Row value expressions
+
+The provider now supports translations which make use of *row value expressions*, which are conceptually similar to tuples. Row values are particularly useful for implementing *keyset pagination*, which is much more efficient than the common, offset-base pagination. To learn more about pagination techniques, see [this documentation page](https://learn.microsoft.com/ef/core/querying/pagination).
+
+Here's an example comparing two row values as an implementation of keyset pagination:
+
+```csharp
+var nextPage = context.Posts
+ .OrderBy(b => b.Date)
+ .ThenBy(b => b.PostId)
+ .Where(b => EF.Functions.GreaterThan(
+ ValueTuple.Create(b.Date, b.PostId),
+ ValueTuple.Create(lastDate, lastId)))
+ .Take(10)
+ .ToList();
+```
+
+This generates the following SQL:
+
+```sql
+SELECT p."PostId", p."Date"
+FROM "Posts" AS p
+WHERE (p."Date", p."PostId") > (@__lastDate_1, @__lastId_2)
+ORDER BY p."Date", p."PostId"
+LIMIT @__p_3
+```
+
+To the list of row value translations, see the [translations page](../mapping/translations.md#row-value-comparisons).
+
+### Other new features
+
+* Support for PostgreSQL 15 non-distinct NULLs in unique indexes, causing unique constraint violations if a column contains multiple null values. [See the documentation for more details](../modeling/indexes.md#treating-nulls-as-non-distinct).
+* Stored procedure mappings: PostgreSQL support has been added for *stored procedure mapping*, which is a new feature in EF Core 7.0. See the EF [What's new section](https://learn.microsoft.com/ef/core/what-is-new/ef-core-7.0/whatsnew#stored-procedure-mapping) for documentation. Note that PostgreSQL 14 or above is required to use this feature (for output parameters).
+
+## Breaking changes
+
+Note: version 7.0 of the lower-level Npgsql ADO.NET driver, which is used by the EF provider, also has some breaking changes. It's recommended to read the [release notes](/doc/release-notes/7.0.html) for that as well.
+
+### Obsoleted UseXminAsConcurrencyToken
+
+Starting with version 7.0, concurrency token properties can be configured via the standard EF means, rather than the PostgreSQL-specific `UseXminAsConcurrencyToken`; simply configure any `uint` property with the `IsRowVersion()` Fluent API or the `[Timestamp]` Data Annotation. [See the documentation for more details](../modeling/concurrency.md).
+
+### Obsoleted default column collations
+
+Versions 6.0 and below had a mechanism that allowed defining a "default column collation", which is applied individually to every text column by default; this differed from the database collation, which is applied once to the database at creation time. This mechanism was introduced because in PostgreSQL, the database collation is quite limited, and for example does not allow specifying non-deterministic collations (e.g. case-insensitive ones).
+
+However, with the introduction of [pre-convention model configuration](https://docs.microsoft.com/ef/core/modeling/bulk-configuration#pre-convention-configuration) in EF Core, it's now possible to use that generic mechanism for specifying the default collation. As a result, the Npgsql-specific mechanism has been obsoleted and will be removed in a future version.
+
+Default column collations involve the following code:
+
+```csharp
+protected override void OnModelCreating(ModelBuilder modelBuilder)
+{
+ modelBuilder.UseDefaultColumnCollation("");
+}
+```
+
+To switch to the standard EF Core API, replace the code above with the following:
+
+```csharp
+protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
+{
+ configurationBuilder.Properties().UseCollation("");
+}
+```
+
+## Contributors
+
+A big thank you to all the following people who contributed to the 7.0 release!
+
+### [Milestone 7.0.11](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.11)
+
+| Contributor | Assigned issues |
+| -------------------------------- | -----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.11+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 7.0.4](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.4)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [7](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.4+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 7.0.3](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.3)
+
+| Contributor | Assigned issues |
+| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------:|
+| [@jhartmann123](https://github.com/jhartmann123) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.3+is%3Aclosed+assignee%3Ajhartmann123) |
+| [@roji](https://github.com/roji) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.3+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 7.0.1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.1)
+
+| Contributor | Assigned issues |
+| -------------------------------- | ----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [3](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.1+is%3Aclosed+assignee%3Aroji) |
+
+### [Milestone 7.0.0](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.0)
+
+| Contributor | Assigned issues |
+| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [35](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.0+is%3Aclosed+assignee%3Aroji) |
+| [@midgleyc](https://github.com/midgleyc) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A7.0.0+is%3Aclosed+assignee%3Amidgleyc) |
diff --git a/docs/release-notes/8.0.md b/docs/release-notes/8.0.md
new file mode 100644
index 0000000000..a27200bfc5
--- /dev/null
+++ b/docs/release-notes/8.0.md
@@ -0,0 +1,248 @@
+# 8.0 Release Notes
+
+Npgsql.EntityFrameworkCore.PostgreSQL version 8.0 is out and available on [nuget.org](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL).
+
+## Full support for primitive collection querying
+
+One of PostgreSQL unique features as a relational database is its rich support for [array types](https://www.postgresql.org/docs/current/arrays.html), which can be stored just like any other basic data type and queried. The Npgsql EF provider has supported mapping .NET arrays and Lists to PostgreSQL arrays for a very long time; however, with the introducion of [rich primitive collection support in EF itself](https://learn.microsoft.com/ef/core/what-is-new/ef-core-8.0/whatsnew#primitive-collections), Npgsql's support for arrays was extended to include full querying capabilities.
+
+### Column collections
+
+On to the code! You can now use any LINQ operator - or chain of operators - on top of a primitive array or list property. For example, the following queries for all blogs who have at least 3 tags starting with "x":
+
+```csharp
+class Blog
+{
+ ...
+ public List Tags { get; set; }
+}
+
+var blogs = await ctx.Blogs
+ .Where(b => b.Tags.Count(t => t.StartsWith("x")) > 3)
+ .ToListAsync();
+```
+
+This is now translated to the following SQL:
+
+```sql
+SELECT b."Id", b."Tags"
+FROM "Blogs" AS b
+WHERE (
+ SELECT count(*)::int
+ FROM unnest(b."Tags") AS t(value)
+ WHERE t.value LIKE 'x%') > 3
+```
+
+Such complex translations rely on the PostgreSQL [`unnest`](https://www.postgresql.org/docs/current/functions-array.html#ARRAY-FUNCTIONS-TABLE) function, which allows expanding a PostgreSQL array to a set of rows; once that's done, the array values can be queried with regular SQL.
+
+We can go further, querying for all blogs whose tags - or any of their posts' tags - contains a certain value:
+
+```csharp
+var blogs = await ctx.Blogs
+ .Where(b => b.Tags.Union(b.Posts.SelectMany(p => p.Tags))
+ .Contains("foo"))
+ .ToListAsync();
+```
+
+This uses `unnest` both on the blog's tags on and all its posts' tags (via a lateral join), to then do a UNION On results and check whether the value is contained.
+
+```sql
+SELECT b."Id", b."Tags"
+FROM "Blogs" AS b
+WHERE 'foo' IN (
+ SELECT t.value
+ FROM unnest(b."Tags") AS t(value)
+ UNION
+ SELECT t1.value
+ FROM "Post" AS p
+ JOIN LATERAL unnest(p."Tags") AS t1(value) ON TRUE
+ WHERE b."Id" = p."BlogId"
+)
+```
+
+### Parameter collections
+
+But that's not all... The new primitive collection support works not just on columns, but also on parameterized lists. Previously, special and limited support existed for translating Contains over a parameterized list, as follows:
+
+```csharp
+var ids = new[] { 1, 2, 3 };
+
+var blogs = await ctx.Blogs
+ .Where(b => ids.Contains(b.Id))
+ .ToListAsync();
+```
+
+This has now been extended to allow composing any LINQ operator. For example, the following query queries for any blogs which have at least one tag, where that tag starts with a list of possible prefixes:
+
+```csharp
+var prefixes = new[] { "f", "b" };
+
+var blogs = await ctx.Blogs
+ .Where(b => prefixes.Any(p => b.Tags.Any(t => t.StartsWith(p))))
+ .ToListAsync();
+```
+
+Complex, I know! This translates to the following SQL:
+
+```sql
+SELECT b."Id", b."Tags"
+FROM "Blogs" AS b
+WHERE EXISTS (
+ SELECT 1
+ FROM unnest(@__prefixes_0) AS p(value)
+ WHERE EXISTS (
+ SELECT 1
+ FROM unnest(b."Tags") AS t(value)
+ WHERE p.value IS NOT NULL AND left(t.value, length(p.value)) = p.value))
+```
+
+Note the two usages of `unnest` here: one is used to expand the Tags column, whereas the other is used to expand the `@__prefixes_0` array parameter that EF sends. All this machinery works together to make your LINQ query execute correctly.
+
+### Inline collections
+
+Finally, support was added to *inline collections*, which are collections specified *inside* the query. For example, let's say that the list of tag prefixes in the previous query were always the same; in that case, we'd inline the prefixes variable as follows:
+
+```csharp
+var blogs = await ctx.Blogs
+ .Where(b => new[] { "f", "b" }.Any(p => b.Tags.Any(t => t.StartsWith(p))))
+ .ToListAsync();
+```
+
+This translates to the following:
+
+```sql
+ SELECT b."Id", b."Tags"
+ FROM "Blogs" AS b
+ WHERE EXISTS (
+ SELECT 1
+ FROM (VALUES ('f'::text), ('b')) AS v("Value")
+ WHERE EXISTS (
+ SELECT 1
+ FROM unnest(b."Tags") AS t(value)
+ WHERE left(t.value, length(v."Value")) = v."Value"))
+```
+
+Note that the `unnest` over the parameter has been replaced with a standard SQL `VALUES` construct, which allows constructing a set of rows inline, inside the query.
+
+### More information
+
+Exciting stuff! We hope this helps you use LINQ to model and better interact with your database.
+
+* [The primitive collection section](https://learn.microsoft.com/ef/core/what-is-new/ef-core-8.0/whatsnew#primitive-collections) in the EF 8.0 What's New page.
+* [.NET Blog post on primitive collections](https://devblogs.microsoft.com/dotnet/announcing-ef8-preview-4/)
+* [PostgreSQL-specific information on primitive collections](https://www.roji.org/queryable-pg-arrays-in-ef8), including some specialized translations done for PostgreSQL.
+
+## EF JSON support via ToJson()
+
+Version 8.0 also brings support for EF7's [JSON columns](https://learn.microsoft.com/ef/core/what-is-new/ef-core-7.0/whatsnew#json-columns) feature (ToJson), which allows mapping JSON columns via owned entity types. While the Npgsql EF provider has had POCO JSON mapping for a very long time, the full modeling of the new ToJson() allows for a more powerful mapping strategy, with more query and update features. ToJson is the recommended way to map JSON going forward.
+
+You can read more on ToJson in the [Npgsql JSON doc page](../mapping/json.md), and in the [EF7 what's new docs](https://learn.microsoft.com/ef/core/what-is-new/ef-core-7.0/whatsnew#json-columns). Compared to the traditional Npgsql-specific POCO approach, a much wider range of LINQ queries can now be translated. For example, you can now compose LINQ operators over collections within JSON documents:
+
+```csharp
+var blogs = await ctx.Customers
+ .Where(b => b.Details.Orders.Any(o => o.Price > 8))
+ .ToListAsync();
+```
+
+Note that this composes a LINQ operator - Any - on top of Orders, which is a list nested inside a JSON document. This translates to the following SQL:
+
+```sql
+SELECT c."Id", c."Details"
+FROM "Customers" AS c
+WHERE EXISTS (
+ SELECT 1
+ FROM ROWS FROM (jsonb_to_recordset(c."Details" -> 'Orders') AS (
+ "Price" numeric,
+ "ShippingAddress" text
+ )) AS o
+ WHERE o."Price" > 8.0)
+```
+
+Note the [`jsonb_to_recordset`](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE) function, which drills into the JSON document, finds the Orders property, and then expands that out to a set of rows, which can then be queried via regular SQL.
+
+Similarly, updates via EF's SaveChanges() are better, and can leverage *partial updating* to only patch the part of the JSON document which has changed. For example, let's assume that we load some customer with a JSON column, and change a single property within that JSON data:
+
+```csharp
+var customer = await ctx.Customers.SingleAsync(c => c.Details.Name == "Foo");
+customer.Details.Name = "Bar";
+await ctx.SaveChangesAsync();
+```
+
+Rather than needlessly sending the entire JSON document back to PostgreSQL, the EF provider uses the [`jsonb_set`](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING-TABLE) function to patch the specific property which changed, which is more efficient:
+
+```sql
+UPDATE "Customers" SET "Details" = jsonb_set("Details", '{Name}', @p0)
+WHERE "Id" = @p1;
+```
+
+## Other new features
+
+Version 8.0 contains many other smaller features and bug fixes, both on the EF side and on the Npgsql provider side. [See the 8.0.0 milestone](https://github.com/npgsql/efcore.pg/milestone/53?closed=1) for the full list of Npgsql EF provider issues.
+
+## Breaking changes
+
+Note: version 8.0 of the lower-level Npgsql ADO.NET driver, which is used by the EF provider, also has some breaking changes. It's recommended to read the [release notes](/doc/release-notes/8.0.html) for that as well.
+
+### JSON POCO and other dynamic features now require an explicit opt-in
+
+Because of the NativeAOT and trimming work done for Npgsql 8.0 ([release notes](/doc/release-notes/8.0.html)), certain features now require an explicit opt-in, which you must add either on your or on :
+
+PostgreSQL type | Default .NET type
+---------------------------------------- | --------------------------
+JSON POCO mapping, JsonNode and subtypes |
+Unmapped enums, ranges, multiranges |
+Read PostgreSQL records as .NET tuples |
+
+Existing code using the above features will start throwing exceptions after upgrading to version 8.0 of the EF Core provider; the exceptions provide explicit guidance on how to add the opt-ins.
+
+Note that EF Core itself is not yet compatible with NativeAOT, and Npgsql can only be used in NativeAOT applications without EF Core.
+
+### Default PostgreSQL compatibility mode has been bumped from 12 to 14
+
+This means that the provider assumes at least PostgreSQL 14; if you're running against an older version, explicitly specify the PostgreSQL version when configuring your context:
+
+```csharp
+optionsBuilder.UseNpgsql("", o => o.SetPostgresVersion(12, 0))
+```
+
+### Obsoleted HasPostgresArrayConversion
+
+With EF 8.0 introducing first-class support for [primitive collections](https://devblogs.microsoft.com/dotnet/announcing-ef8-preview-4), the PostgreSQL driver aligned its PostgreSQL array support to use that. As a result, `HasPostgresArrayConversion` can no longer be used to configure value-converted arrays; instead, the new standard EF mechanism can be used.
+
+For example, the following Npgsql-specific code would configure value conversion for a property of type `MyType[]` to a PostgreSQL array of strings in EF Core 6 or 7:
+
+```csharp
+modelBuilder.Entity().Property(b => b.ValueConvertedArray)
+ .HasPostgresArrayConversion(x => x.ToString(), s => MyType.Parse(s));
+```
+
+The same can now achieved with the following standard EF 8 code:
+
+```csharp
+modelBuilder.Entity().PrimitiveCollection(b => b.ValueConvertedArray)
+ .ElementType()
+ .HasConversion(typeof(MyConverter));
+
+class MyConverter : ValueConverter
+{
+ public MyConverter()
+ : base(x => x.ToString(), s => MyType.Parse(s))
+ {
+ }
+}
+```
+
+### `cidr` now maps to `NpgsqlCidr` instead of `ValueTuple`
+
+As part of improving Npgsql's support for the PostgreSQL network mappings, the PostgreSQL `cidr` type now maps to the newly-introduced , and can no longer be mapped to `ValueTuple`.
+
+## Contributors
+
+A big thank you to all the following people who contributed to the 8.0 release!
+
+### [Milestone 8.0.0](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A8.0.0)
+
+| Contributor | Assigned issues |
+| ---------------------------------- | -----------------------------------------------------------------------------------------------------------:|
+| [@roji](https://github.com/roji) | [34](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A8.0.0+is%3Aclosed+assignee%3Aroji) |
+| [@zpaks](https://github.com/zpaks) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A8.0.0+is%3Aclosed+assignee%3Azpaks) |
diff --git a/docs/release-notes/9.0.md b/docs/release-notes/9.0.md
new file mode 100644
index 0000000000..72d0f5478a
--- /dev/null
+++ b/docs/release-notes/9.0.md
@@ -0,0 +1,98 @@
+# 9.0 Release Notes
+
+Npgsql.EntityFrameworkCore.PostgreSQL version 9.0 is out and available on [nuget.org](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL).
+
+## Improved, unified configuration experience
+
+The Npgsql EF provider is built on top of the lower-level Npgsql ADO.NET provider; the configuration interface between these two layers was less than ideal, and configuration been more difficult than it should have been. For version 9.0, the configuration experience has been considerably improved.
+
+Since version 7, the Npgsql ADO.NET provider has been moving to [NpgsqlDataSource](/doc/basic-usage.html#data-source) as the preferred way of configuring connections and obtaining them. At the EF level, it has been possible to pass an NpgsqlDataSource instance to `UseNpgsql()`; but this required that the user separately configure a data source and manage it. In addition, features such as plugins and enums require support from both the EF and ADO.NET layers, forcing users to perform multiple setup actions at the different layers.
+
+With version 9, `UseNpgsql()` becomes a single point for configuration, for both the EF and ADO.NET levels. EF can now internally set up an NpgsqlDataSource, automatically applying all the necessary configuration to it, and also exposes an API to allow users to apply arbitrary configuration to it as well:
+
+```csharp
+builder.Services.AddDbContextPool(opt =>
+ opt.UseNpgsql(
+ builder.Configuration.GetConnectionString("BloggingContext"),
+ o => o
+ .SetPostgresVersion(13, 0)
+ .UseNodaTime()
+ .MapEnum("mood")
+ .ConfigureDataSource(dataSourceBuilder => dataSourceBuilder.UseClientCertificate(certificate))));
+```
+
+In the above code, the following configuration gestures are performed:
+
+1. `SetPostgresVersion()` is an EF-only option to produce SQL for PostgreSQL version 13 (avoiding newer incompatible features)
+2. `UseNodaTime()`, adds a plugin allowing use of NodaTime for date/time type mapping. This also requires an ADO.NET NodaTime plugin which needed to be configured separately, but this is now done automatically.
+3. `MapEnum()` maps a .NET enum type. Like `UseNodaTime()`, this also used to require a separate ADO.NET configuration gesture, but is now done automatically. As an added bonus, doing this now also adds the enum to the model, causing the enum to be created in the database via EF's migrations.
+4. `ConfigureDataSource()` exposes an NpgsqlDataSourceBuilder, which you can use to configure arbitrary ADO.NET options. In this example, the certificate is defined for the TLS authentication process.
+
+For more information, see the [getting started docs](../index.md).
+
+### Improved configuration for enums and plugins
+
+Previously, configuration around enums and plugins (NodaTime, NetTopologySuite) was complicated, requiring multiple setup actions at both the EF and the lower-level Npgsql layers. EF 9.0 improves the configuration story, allowing you to configure enums and plugins via a single EF gesture:
+
+```csharp
+builder.Services.AddPooledDbContext(options => options.UseNpgsql(
+ "",
+ o => o.MapEnum("mood")));
+```
+
+This takes care of everything - EF configuration, lower-level Npgsql configuration and even the addition of the enum to the EF model, which ensures that the enum is created in the database in EF migrations.
+
+See the [enum](../mapping/enum.md), [NodaTime](../mapping/nodatime.md) and [NetTopologySuite](../mapping/nts.md) documentation for more details.
+
+## UUIDv7 GUIDs are generated by default
+
+When your entity types have a `Guid` key, EF Core by default generates key values for new entities client-side - in .NET - before inserting those entity types to the database; this can be better for performance in some situations. Before version 9.0, the provider generated random GUIDs (version 4) by calling the .NET [`Guid.NewGuid()`](https://learn.microsoft.com/en-us/dotnet/api/system.guid.newguid?view=net-8.0#system-guid-newguid) function. Unfortunately, random GUIDs aren't ideal for database indexing and can cause performance issues.
+
+Version 9.0 of the provider now generates the recently standardized version 7 GUIDs, which is a sequential GUID type that's more appropriate for database indexes and improves their performance. This new behavior is on by default and takes effect simply by upgrading the provider version.
+
+See [this post](https://www.cybertec-postgresql.com/en/unexpected-downsides-of-uuid-keys-in-postgresql) for more details and performance numbers on random vs. sequential GUIDs.
+
+Thanks to [@ChrisJollyAU](https://github.com/ChrisJollyAU) and [@Timovzl](https://github.com/Timovzl) for contributing this improvement!
+
+## Other new features
+
+* Translate `array.Where(i => i != x)` to `array_remove(array, x)`
+* Translate `DateOnly.DayNumber`, `DateOnly.FromDayNumber()` and simplify `dateOnly1.DayNumber - dateOnly2.DayNumber` to `dateOnly1 - dateOnly2`.
+* Map the PostgreSQL `jsonpath` type to .NET string; this allows mapping to `jsonpath` columns.
+
+See the [9.0.0 milestone](https://github.com/npgsql/efcore.pg/milestone/61?closed=1) for the full list of Npgsql EF provider issues.
+
+## Breaking changes
+
+### Enum mappings must now be configured at the EF level
+
+Previously, enum configuration involved mapping the enum at the lower-level Npgsql layer (either via `NpgsqlDataSourceBuilder.MapEnum` or via `NpgsqlConnection.GlobalTypeMapper.MapEnum`); the EF provider automatically picked this configuration up for the EF-level setup. Unfortunately, this design created numerous issues and bugs.
+
+As part of the improved enum configuration story in version 9.0 ([see above](#improved-configuration-for-enums-and-plugins)), enums must now be configured at the EF level; although this is a breaking change for existing applications, it usually results in simplified setup code and fixes various bugs and problematic behavior.
+
+If your application calls `UseNpgsql` with a simple connection string (rather than an NpgsqlDataSource), it simply needs to add a `MapEnum` call there:
+
+```csharp
+builder.Services.AddDbContext(options => options.UseNpgsql(
+ "",
+ o => o.MapEnum("mood")));
+```
+
+All other setup code - the `MapEnum` call on `NpgsqlConnection.GlobalTypeMapper` and the `HasPostgresEnum` call in `OnModelCreating` - can be removed.
+
+If your application passes an NpgsqlDataSource to `UseNpgsql`, it also needs to add the `MapEnum` call as above; but the `MapEnum` call on `NpgsqlDataSourceBuilder` must also be kept.
+
+See the [enum documentation](../mapping/enum.md) for more information.
+
+## Contributors
+
+A big thank you to all the following people who contributed to the 9.0 release!
+
+### [Milestone 9.0.0](https://github.com/npgsql/efcore.pg/milestone/61?closed=1)
+
+Contributor | Assigned issues
+------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------
+[@roji](https://github.com/roji) | [28](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A9.0.0+is%3Aclosed+assignee%3Aroji)
+[@ChrisJollyAU](https://github.com/ChrisJollyAU) | [2](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A9.0.0+is%3Aclosed+assignee%3AChrisJollyAU)
+[@Timovzl](https://github.com/Timovzl) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A9.0.0+is%3Aclosed+assignee%3ATimovzl)
+[@WhatzGames](https://github.com/WhatzGames) | [1](https://github.com/Npgsql/efcore.pg/issues?q=is%3Aissue+milestone%3A9.0.0+is%3Aclosed+assignee%3AWhatzGames)
diff --git a/docs/toc.yml b/docs/toc.yml
new file mode 100644
index 0000000000..457bd5f829
--- /dev/null
+++ b/docs/toc.yml
@@ -0,0 +1,74 @@
+- name: Getting started
+ href: index.md
+- name: Release notes
+ items:
+ - name: "11.0"
+ href: release-notes/11.0.md
+ - name: "10.0"
+ href: release-notes/10.0.md
+ - name: "9.0"
+ href: release-notes/9.0.md
+ - name: "8.0"
+ href: release-notes/8.0.md
+ - name: Out of support
+ items:
+ - name: "7.0"
+ href: release-notes/7.0.md
+ - name: "6.0"
+ href: release-notes/6.0.md
+ - name: "5.0"
+ href: release-notes/5.0.md
+ - name: "3.1"
+ href: release-notes/3.1.md
+ - name: "2.2"
+ href: release-notes/2.2.md
+ - name: "2.1"
+ href: release-notes/2.1.md
+ - name: "2.0"
+ href: release-notes/2.0.md
+ - name: "1.1"
+ href: release-notes/1.1.md
+- name: Creating a model
+ items:
+ - name: Tables
+ href: modeling/tables.md
+ - name: Generated properties
+ href: modeling/generated-properties.md
+ - name: Indexes
+ href: modeling/indexes.md
+ - name: Concurrency tokens
+ href: modeling/concurrency.md
+- name: Mapping and translation
+ items:
+ - name: General
+ href: mapping/general.md
+ - name: Translations
+ href: mapping/translations.md
+ - name: JSON
+ href: mapping/json.md
+ - name: Spatial data
+ href: mapping/nts.md
+ - name: Full text search
+ href: mapping/full-text-search.md
+ - name: Vector search
+ href: mapping/vector-search.md
+ - name: NodaTime
+ href: mapping/nodatime.md
+ - name: Arrays
+ href: mapping/array.md
+ - name: Enums
+ href: mapping/enum.md
+ - name: Ranges
+ href: mapping/range.md
+- name: Miscellaneous
+ items:
+ - name: Collations and case sensitivity
+ href: misc/collations-and-case-sensitivity.md
+ - name: Database creation
+ href: misc/database-creation.md
+ - name: Temporal constraints
+ href: misc/temporal-constraints.md
+ - name: Other
+ href: misc/other.md
+- name: API reference
+ href: ../../obj/api/EFCore.PG/