motherduck-duckdb-sql

Convert PostgreSQL SQL syntax and semantics to DuckDB-correct SQL for MotherDuck.

53|3|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/motherduckdb/agent-skills --skill motherduck-duckdb-sql
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: motherduck-duckdb-sql
Source: https://github.com/motherduckdb/agent-skills/tree/main/plugins/motherduck-skills-claude/skills/motherduck-duckdb-sql
Command: npx skills add https://github.com/motherduckdb/agent-skills --skill motherduck-duckdb-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It resolves confusion and production bugs caused by writing PostgreSQL-shaped SQL when the real target is DuckDB-on-MotherDuck, including MotherDuck-specific SQL capabilities and version-sensitive syntax.

Core Features & Use Cases

  • DuckDB-first SQL correctness: Guides you to use DuckDB-native syntax and semantics even when you connect through a Postgres endpoint.
  • MotherDuck feature awareness: Helps distinguish DuckDB core SQL from MotherDuck operational commands and server-mode limitations.
  • Version-lifecycle guardrails: Advises checking MotherDuck lifecycle and connection-path behavior before relying on newer upstream DuckDB features.

Quick Start

Ask: “Rewrite this query as DuckDB SQL for MotherDuck and explain what will fail versus PostgreSQL, given this statement: [paste SQL]”.

Frequently Asked Questions about motherduck-duckdb-sql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rewrite PostgreSQL SQL into DuckDB syntax for MotherDuck?▼

To rewrite PostgreSQL SQL for MotherDuck, you must translate Postgres-specific functions and syntax into DuckDB-native constructs, validating identifier rules and MotherDuck-only features to ensure correct execution.

Why does my PostgreSQL query fail when running on DuckDB through MotherDuck?▼

Your PostgreSQL query fails on MotherDuck because DuckDB has different syntax and function semantics, requiring DuckDB-native constructs and validation of MotherDuck server-mode limitations to resolve errors.

Does MotherDuck support all the same SQL features as standard DuckDB?▼

MotherDuck does not support all standard DuckDB features identically, because it applies server-mode limitations and version-lifecycle constraints that require checking connection paths before relying on newer upstream DuckDB capabilities.

What is the difference between DuckDB core SQL and MotherDuck operational commands?▼

DuckDB core SQL handles standard data querying and analytics, while MotherDuck operational commands manage platform-specific capabilities, requiring you to distinguish between them to avoid executing unsupported server-mode statements.

Can I use newer DuckDB SQL features immediately on a MotherDuck connection?▼

You cannot always use newer DuckDB features on MotherDuck immediately, because MotherDuck's version lifecycle and connection-path behavior require validation before relying on recently introduced upstream DuckDB syntax.

How do I debug SQL syntax errors when connecting to MotherDuck through a Postgres endpoint?▼

To debug SQL syntax errors on MotherDuck via a Postgres endpoint, you must check for PostgreSQL-to-DuckDB incompatibilities and apply DuckDB-native identifier rules and constructs instead of assuming Postgres compatibility.