Connect a Redis client
Complete Quick start first. This tutorial uses redis-cli, the pgredis_app role and the pgredis_demo database with the gateway listening on 127.0.0.1:6379 (or 56379 if started with the default -listen flag).
Open a RESP2 session
Connect with redis-cli and authenticate as pgredis_app:
Enter the password for the pgredis_app PostgreSQL role, then run the following commands at the prompt:
SELECT 1 switches the current connection to logical database 1. Because pgredis:demo:client was created in logical database 0, EXISTS in database 1 returns 0. Switching back to SELECT 0 finds and deletes the key.
Use RESP3
The gateway supports both RESP2 and RESP3 on the same listener. Pass -3 to redis-cli (or send HELLO 3) to negotiate RESP3:
Both protocol versions read and write the same PostgreSQL tables.
Handle lost responses
Each standalone command commits in PostgreSQL before the gateway writes the reply to the client socket. If the network drops after PostgreSQL commits but before the client reads the reply, the write has already taken effect. Do not blindly retry non-idempotent commands such as INCR or LPUSH; see Disconnects and unknown outcomes.
