0
0
Supabasecloud~10 mins

Connection pooling with PgBouncer in Supabase - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the PgBouncer service in the Supabase configuration.

Supabase
services:
  - name: [1]
    image: pgbouncer/pgbouncer
Drag options to blanks, or click blank then click option'
Aredis
Bpostgres
Cpgbouncer
Dsupabase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'postgres' instead of 'pgbouncer' as the service name.
Naming the service 'redis' or 'supabase' which are unrelated.
2fill in blank
medium

Complete the PgBouncer configuration to set the pool mode to transaction.

Supabase
[pgbouncer]
pool_mode = [1]
Drag options to blanks, or click blank then click option'
Asession
Bidle
Cstatement
Dtransaction
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'session' mode which holds connections longer.
Using 'statement' mode which is less common.
Using 'idle' which is not a valid pool mode.
3fill in blank
hard

Fix the error in the PgBouncer userlist configuration line.

Supabase
"userlist.txt" contains: "[1]"
Drag options to blanks, or click blank then click option'
A"admin" "password"
Badmin password
C""admin"" "password"
D'admin' 'password'
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes instead of double quotes.
Adding extra double quotes inside the string.
Not quoting username and password.
4fill in blank
hard

Fill both blanks to configure PgBouncer to listen on all interfaces and use port 6432.

Supabase
[pgbouncer]
listen_addr = [1]
listen_port = [2]
Drag options to blanks, or click blank then click option'
A"0.0.0.0"
B"127.0.0.1"
C6432
D5432
Attempts:
3 left
💡 Hint
Common Mistakes
Using 127.0.0.1 which restricts connections to localhost.
Using port 5432 which is PostgreSQL default, not PgBouncer's.
5fill in blank
hard

Fill all three blanks to define a database entry in PgBouncer's config for Supabase.

Supabase
[databases]
[1] = host=[2] port=[3] dbname=supabase
Drag options to blanks, or click blank then click option'
Asupabase_db
Blocalhost
C5432
Dpgbouncer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pgbouncer' as database key instead of 'supabase_db'.
Using PgBouncer port 6432 as the host port instead of PostgreSQL port 5432.
Using wrong host name.