Skip to main content

Troubleshoot `max clients reached in session mode` in PostgreSQL exports

Fix a PostgreSQL export to Supabase that fails because the Session pooler has no free connections.

Problem summary

Your PostgreSQL export to Supabase can't connect because the Supabase Session pooler has no free connections.

​

Error message or symptoms

The export fails with an error that contains:

​

FATAL: (EMAXCONNSESSION) max clients reached in session mode - max clients are limited to pool_size: 15

​

When does this occur

  • You connect the export to the Supabase Session pooler.

  • Other apps use the same database user and database at the same time, or the export sends many parts at once.

​

Root cause

The Session pooler keeps one connection for each client and rejects new clients once it reaches its pool size, which is 15 by default. Your other apps share the same pool, and an export runs its parts in parallel. Funnel retries for up to 20 minutes before the part fails.

​

Solution

Do one of the following, then run the export again:

​

  • Raise the pool size: In your Supabase dashboard, increase Pool Size under Database > Connection pooling.

  • Use the direct host: Turn on the Supabase IPv4 add-on under Project Settings > Add-ons. Then change the export's Host to db.<project-ref>.supabase.co, the direct Supabase host.

​

In the export's connection, also remove .<project-ref> from the username, for example funnel_export instead of funnel_export.<project-ref>.

Did this answer your question?