# MD_ATTACHED_DATABASES


> List databases attached to your DuckDB and MotherDuck session.

`MD_ATTACHED_DATABASES()` lists the databases attached in your session, including MotherDuck databases, shares, and local databases.

Use [`SHOW ALL DATABASES`](/sql-reference/motherduck-sql-reference/show-databases) when you also want to see detached MotherDuck databases available to you.

## Syntax

```sql
FROM md_attached_databases();
```

## Output

| Column Name | Data Type | Value |
|-------------|-----------|-------|
| `alias` | VARCHAR | Attached database alias |
| `is_share` | BOOLEAN | Whether the attached database is a share |
| `is_readonly` | BOOLEAN | Whether the database is attached read-only |
| `is_error_catalog` | BOOLEAN | Whether the attachment is an error catalog |
| `error_message` | VARCHAR | Error message for error catalogs, if any |
| `is_ducklake` | BOOLEAN | Whether the attached database is a DuckLake database |

## Example usage

```sql
FROM md_attached_databases();
```

```sql
SELECT alias
FROM md_attached_databases()
WHERE is_share;
```


---

## Docs feedback

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

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmotherduck-sql-reference%2Fmd-attached-databases%2F&page_title=MD_ATTACHED_DATABASES&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

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