---
sidebar_position: 7
title: MD_LIST_DIVE_VERSIONS
description: List all versions of a specific Dive with pagination support.
feature_stage: preview
---

Lists all versions of a specific [Dive](/key-tasks/ai-and-motherduck/dives) with pagination support. Each time a Dive's content is updated via [`MD_UPDATE_DIVE_CONTENT`](../md-update-dive-content), a new version is created. This function returns version metadata without the content.

## Syntax

```sql
SELECT * FROM MD_LIST_DIVE_VERSIONS(id = 'your-dive-uuid'::UUID);
SELECT * FROM MD_LIST_DIVE_VERSIONS(
  id = 'your-dive-uuid'::UUID,
  "limit" = 100,
  "offset" = 0
);
```

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | `UUID` | Yes | The unique identifier of the Dive |
| `limit` | `UINTEGER` | No | Maximum number of versions to return |
| `offset` | `UINTEGER` | No | Number of versions to skip |

:::tip
`limit` and `offset` are reserved SQL keywords and must be double-quoted when used as named parameters.
:::

## Return Columns

| Column | Type | Description |
|--------|------|-------------|
| `id` | `UUID` | UUID of this version |
| `version` | `UINTEGER` | Version number (0-based) |
| `storage_url` | `VARCHAR` | Storage URL of the version content |
| `description` | `VARCHAR` | Version description or commit message |
| `created_at` | `TIMESTAMP WITH TIME ZONE` | When this version was created |
| `api_version` | `UINTEGER` | API version used to create this version |

## Examples

List all versions of a Dive:

```sql
SELECT version, description, created_at
FROM MD_LIST_DIVE_VERSIONS(id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID);
```

Get the 5 most recent versions:

```sql
SELECT version, description, created_at
FROM MD_LIST_DIVE_VERSIONS(id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID)
ORDER BY version DESC
LIMIT 5;
```

## Errors

Returns an error if the Dive does not exist.

## Related

- [`MD_GET_DIVE_VERSION`](../md-get-dive-version) — Retrieve a specific version including content
- [`MD_UPDATE_DIVE_CONTENT`](../md-update-dive-content) — Create a new version


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/sql-reference/motherduck-sql-reference/ai-functions/dives/md-list-dive-versions/",
  "page_title": "MD_LIST_DIVE_VERSIONS",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
