import { useParams } from 'common' import { AlertTriangleIcon } from 'lucide-react' import { Alert, AlertDescription, AlertTitle, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogSection, DialogSectionSeparator, DialogTitle, } from 'ui' import { Markdown } from '@/components/interfaces/Markdown' import { DocsButton } from '@/components/ui/DocsButton' import { useSupavisorConfigurationQuery } from '@/data/database/supavisor-configuration-query' import { DOCS_URL } from '@/lib/constants' import { useDatabaseSelectorStateSnapshot } from '@/state/database-selector' import { useDatabaseSettingsStateSnapshot } from '@/state/database-settings' export const PoolingModesModal = () => { const { ref: projectRef } = useParams() const snap = useDatabaseSettingsStateSnapshot() const state = useDatabaseSelectorStateSnapshot() const { data } = useSupavisorConfigurationQuery({ projectRef: projectRef }) const primaryConfig = data?.find((x) => x.identifier === state.selectedDatabaseId) const navigateToPoolerSettings = () => { const el = document.getElementById('connection-pooler') if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }) } return (

Which pooling mode should I use?

A connection pooler is a system (external to Postgres) which manages Postgres connections by allocating connections whenever clients make requests.
{primaryConfig?.pool_mode === 'session' && (
Pooling mode is currently configured to use session mode To use transaction mode concurrently with session mode, change the pooling mode to transaction first in the{' '} { snap.setShowPoolingModeHelper(false) navigateToPoolerSettings() }} > connection pooling settings . After this, you can use transaction mode on port 6543 and session mode on port 5432.
)} snap.setShowPoolingModeHelper(false)}>
) }