From b01b0f9e75a9e7d43e60cf5545651a6186deafc8 Mon Sep 17 00:00:00 2001 From: Arthur Zakirov Date: Fri, 9 Aug 2019 13:41:57 +0300 Subject: [PATCH] Issue #26: Add pgv_set() and pgv_get() arguments description --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 0c584c0..01be495 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,28 @@ Function | Returns `pgv_set(package text, name text, value anyarray, is_transactional bool default false)` | `void` `pgv_get(package text, name text, var_type anyarray, strict bool default true)` | `anyarray` +`pgv_set` arguments: +- `package` - name of the package, it will be created if it doesn't exist. +- `name` - name of the variable, it will be created if it doesn't exist. +`pgv_set` fails if the variable already exists and its transactionality doesn't +match `is_transactional` argument. +- `value` - new value for the variable. `pgv_set` fails if the variable already +exists and its type doesn't match new value's type. +- `is_transactional` - transactionality of the newly created variable, by +default it is false. + +`pgv_get` arguments: +- `package` - name of the existing package. If the package doesn't exist result +depends on `strict` argument: if it is false then `pgv_get` returns NULL +otherwise it fails. +- `name` - name of the the existing variable. If the variable doesn't exist +result depends on `strict` argument: if it is false then `pgv_get` returns NULL +otherwise it fails. +- `var_type` - type of the existing variable. It is necessary to pass it to get +correct return type. +- `strict` - pass false if `pgv_get` shouldn't raise an error if a variable or a +package didn't created before, by default it is true. + ## **Deprecated** scalar variables functions ### Integer variables