Postgresql Javascript Function Examples