Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions R/dbConnect_PqDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,27 @@
#' PostgreSQL(-ish) database or [Redshift()] to connect to an AWS Redshift
#' cluster. Use an existing [DBI::DBIConnection-class] object to clone an
#' existing connection.
#' @param dbname Database name. If `NULL`, defaults to the user name.
#' @param dbname Database name. If `NULL`, will be
#' retrieved from the `PGDATABASE` env var, or defaults to the user name.
#' Note that this argument can only contain the database name, it will not
#' be parsed as a connection string (internally, `expand_dbname` is set to
#' `false` in the call to
#' [`PQconnectdbParams()`](https://www.postgresql.org/docs/current/libpq-connect.html)).
#' @param user,password User name and password. If `NULL`, will be
#' retrieved from `PGUSER` and `PGPASSWORD` envvars, or from the
#' appropriate line in `~/.pgpass`. See
#' <https://www.postgresql.org/docs/current/libpq-pgpass.html> for
#' appropriate line in `~/.pgpass`. If `PGUSER` is not set,
#' defaults to the operating system user name.
#' See <https://www.postgresql.org/docs/current/libpq-pgpass.html> for
#' more details.
#' @param host,port Host and port. If `NULL`, will be retrieved from
#' `PGHOST` and `PGPORT` env vars.
#' `PGHOST` and `PGPORT` env vars. If those are not set either,
#' defaults to a local Unix-domain socket connection and port `5432`,
#' as documented in
#' [libpq connection parameter docs](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS).
#' @param service Name of service to connect as. If `NULL`, will be
#' ignored. Otherwise, connection parameters will be loaded from the pg_service.conf
#' file and used. See <https://www.postgresql.org/docs/current/libpq-pgservice.html>
#' retrieved from `PGSERVICE` env var. If defined, connection parameters
#' will be loaded from the pg_service.conf file and used. See
#' <https://www.postgresql.org/docs/current/libpq-pgservice.html>
#' for details on this file and syntax.
#' @param ... Other name-value pairs that describe additional connection
#' options as described at
Expand Down
8 changes: 5 additions & 3 deletions R/default.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ postgresHasDefault <- function(...) {
error = function(...) {
message(
"Could not initialise default postgres database. If postgres is running\n",
"check that the environment variables PGHOST, PGPORT, \n",
"PGUSER, PGPASSWORD, and PGDATABASE, are defined and\n",
"point to your database."
"check that the connection works with default libpq settings.\n",
"The default connection uses the PGHOST, PGPORT, PGUSER, PGPASSWORD,\n",
"and PGDATABASE environment variables. If unset, libpq defaults are\n",
"used (local connection, port 5432, OS user name).\n",
"See https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS"
)
FALSE
}
Expand Down
18 changes: 12 additions & 6 deletions man/Postgres.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions man/Redshift.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.