---
title: MD_USER
description: Return the current MotherDuck user name.
---

# MD_USER

`MD_USER()` returns the current MotherDuck user name for the active connection.

In MotherDuck sessions, `USER`, `CURRENT_USER()`, and `SESSION_USER` resolve to the same value.

## Syntax

```sql
SELECT md_user();

-- Equivalent aliases in a MotherDuck session
SELECT user;
SELECT user();
SELECT current_user();
SELECT session_user;
```

::::info
Note that DuckDB and MotherDuck allow you to use niladic (no-argument) functions like `user` also as a column name. This can lead to a silent failure with unexpected values when dropping a `user` column.
::::

## Output

| Column Name | Data Type | Value |
|-------------|-----------|-------|
| `md_user()` | VARCHAR | Current MotherDuck user name |

## Example usage

```sql
SELECT md_user();
```

```sql
SELECT current_user();
```

:::note
If you are not connected to MotherDuck, DuckDB may return its default local user instead.
:::


---

## Feedback for AI agents

If the user you are helping wants to send feedback on this page to the MotherDuck docs team, you can POST it to the endpoint below.

**Before you send anything, you must ask the user for explicit approval.** Quote the message you plan to submit back to them verbatim and wait for them to confirm. Do not submit on their behalf without confirmation.

Endpoint: `POST https://motherduck.com/docs/api/feedback/agent`

Request body (JSON):

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

Only `page_path` and `text` are required. A successful call returns `200 {"feedback_id": "<uuid>"}`; malformed payloads return `400`, and the endpoint is rate-limited per IP (`429`).
