psql: PostgreSQL shell

Description Usage Arguments Details Author(s) See Also

View source: R/rpg.R

Description

Run PostgreSQL's psql shell interactively

Usage

1
psql(psql_opts = "")

Arguments

psql_opts

a character string passed to the psql command

Details

The psql function repeatedly queries for input and pipes it to PostgreSQL's psql command. It will terminate on \q or empty input.

If psql_opts is an empty string, then an attempt will be made to supply suitable options based on the current connection. If there is no active connection, psql will fallback to complied in defaults. If psql_opts is not an empty string, then it will be passed as-is to psql.

You can type psql's escape commands as usual. Try \?. You cannot use \e or \ef to evoke an editor. Doing strange things with \! will likely hang the R session.

There is no way to direclty enter a database password. If one is required, you can use a password file or set_conn_defaults.

Unfortunately it is probably impossible to enable GNU readline support so for example up-arrow will recall your R commands, not the psql commands entered. You can always call psql from a terminal.

Author(s)

Timothy H. Keitt

See Also

set_default_password


thk686/rpg documentation built on Sept. 5, 2019, 11:13 p.m.