Redis offers Redis Data Integration (RDI) for this. With RDI you can sync your Redis with the Postgres tables you want and transform the data to any Redis data type you want without coding.