Example: convert a currency in result set on the fly
In this example, we look up exchange rates using a REST call and translate a price into a different currency on the fly, using the latest exchange rate.
A few things that are of interest in this example:
the code makes a REST call to an outside service
the result of the REST call is cached so that we only have to make the call once an hour
the column "list_price" is recomputed using the exchange rate
The following is the code for a Postgres result set filter for table products in the tutorial database.
The end result is that the list_price data received by the database clients is now automatically converted to Canadian dollars.