Miscelaneous functions

Share:

Description

Various utility functions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
libpq_version()

encrypt_password(passwd, user)

get_encoding()

set_encoding(encoding)

set_error_verbosity(verbosity)

enable_postgis(schemaname = "postgis")

Arguments

passwd

the password

user

the user name

encoding

the character encoding

verbosity

one of "terse", "default", "verbose"

schemaname

install in this schema

Details

enable_postgis will attempt to install the postgis extension in the named schema. The default search path is altered to include the new schema.

Author(s)

Timothy H. Keitt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# try connecting to default database
system("createdb rpgtesting")
connect("rpgtesting")
begin()

libpq_version()
encrypt_password("test", "tester")
get_encoding()
set_encoding("UTF8")
set_error_verbosity("terse")
set_error_verbosity("verbose")
set_error_verbosity("default")
enable_postgis()

# cleanup
rollback()
disconnect()
system("dropdb rpgtesting")
## End(Not run)