Question
max_connections versus a role CONNECTION LIMIT: what differs, and when should each be used?
Answer
max_connections caps concurrent connections server-wide, sizes shared memory, and needs a restart to change. A role's CONNECTION LIMIT caps concurrent sessions for that role, but superusers are exempt. Use max_connections for cluster capacity. Use role limits to contain non-superuser tenant or application identities.