variable , (we will be using as a cache) so every time that function is called if a particular condition failed , you are storing in that jsonb so next time we call that same function,we check whether that value exists in that jsonb --- just a variable no table creation involved, will json array updates the data?
This would be the equivalent of a package variable. So. Not directly. You can ENCODE this JSON as a set_config() variable. And read/write it to there. You will have ONE per SESSION (not shared across sessions). And your changes do not survive over ROLLBACKS (so if you throw an error, and rollback your change, it is lost). But you could not do that with a table either. Since PERL supports global variables. A PERL library function could survive the rollback, as well as a JavaScript one. Both require a bit of work.
Обсуждают сегодня