Learn R Programming

rpg (version 1.6)

libpq_version: Miscelaneous functions

Description

Various utility functions

Usage

libpq_version()

encrypt_password(passwd, user)

get_encoding()

set_encoding(encoding)

set_error_verbosity(verbosity)

toggle_echo()

enable_postgis(schemaname = "postgis")

enable_extension(extension, schemaname = extension)

Arguments

passwd

the password

user

the user name

encoding

the character encoding

verbosity

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

schemaname

install in this schema

extension

the extension name

Details

enable_postgis will attempt to install the postgis extension in the named schema using enable_extension.

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

Examples

Run this code
# NOT RUN {
# try connecting to default database
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()
dropdb("rpgtesting")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab