Replicate my database on the same machine

Hi all,
Basically, I would need my testdb database to be replicated into testdb_read database on the same machine. Any example for my case, please?
Found this link, but example below is not clear
Please advise.

do you want this to happen on a regular basis? What are you attempting to do? What is the purpose of this replication?

Yes, on regular basis, as much real-time as possible. It is an assignment that I do for learning purpose. It does not have any real life meaning imho. It would have a meaning in case second database is on different machine though. Please advise.