Name

pgScript — Parses and interprets pgScript scripts (enhanced PostgreSQL scripts).

Synopsis

pgScript -h host [-p port] -d database -U username [-W password] [-e encoding] inputfile

Description

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.

Options

-h host

Database server host to connect to, e.g 127.0.0.1

-p port

Database server port number (default: 5432)

-d database

Database to connect to

-U username

Username to use for connecting to the database server

-W password

Password to use for connecting to the database server (default: nothing)

-e encoding

Encoding of file,e.g utf-8, iso-8859-1 (default: system encoding)

pgScript input file

Path to the file to parse with pgScript (.pgs file)

Example

pgScript -h 127.0.0.1 -U postgres -W postgres -d testbase -e "utf-8" script.pgs

This connects to the database 127.0.0.1:5432/testbase with the credentials postgres/postgres, and parses the UTF-8 encoded file script.pgs. The output is written on screen and is UTF-8 encoded.