pgScript — Parses and interprets pgScript scripts (enhanced PostgreSQL scripts).
pgScript
-h
host
[-p
port
] -U
username
[-W
password
] -d
database
[-e
encoding
] -f
inputfile
[@VAR=VALUE
...]
pgScript parses, interprets pgScript scripts (.pgs files) and outputs the result in the console in UTF-8 format.
pgScript scripts are enhanced PostgreSQL scripts with control-of-flow structures (loops and conditions), local variables and random data generators. The scripting language is described in the documentation accompanying the program. Please refer to it.
host
Database server host to connect to, e.g
127.0.0.1
port
Database server port number (default:
5432
)
username
Username to use for connecting to the database server
password
Password to use for connecting to the database server
(default: nothing
)
database
Database to connect to
encoding
Encoding of file
,e.g utf-8
,
iso-8859-1
(default: system
encoding
)
file
Path to the file to parse with pgScript (.pgs file)
@VAR=VALUE
Pre-sets @VAR
with the value
VALUE
pgScript -h 127.0.0.1 -U postgres -W
postgres -d testbase -e "utf-8" -f script.pgs @var1=1
This connects to the database 127.0.0.1:54322/testbase
with the credentials postgres
/postgres
, pre-sets
@var1
to 1
and parses the UTF-8 encoded file
script.pgs
. Output is written on screen and is UTF-8
encoded.
As variable names begin with a @
, providing a pre-set
variable without a @
will make it inaccessible inside the
script.