quote function

Quote postgres strings, identifiers, and literals

Quote postgres strings, identifiers, and literals

If an object of class Id is used for dbQuoteIdentifier(), it needs at most one table component and at most one schema component.

## S4 method for signature 'PqConnection,Id' dbQuoteIdentifier(conn, x, ...) ## S4 method for signature 'PqConnection,SQL' dbQuoteIdentifier(conn, x, ...) ## S4 method for signature 'PqConnection,character' dbQuoteIdentifier(conn, x, ...) ## S4 method for signature 'PqConnection' dbQuoteLiteral(conn, x, ...) ## S4 method for signature 'PqConnection,SQL' dbQuoteString(conn, x, ...) ## S4 method for signature 'PqConnection,character' dbQuoteString(conn, x, ...) ## S4 method for signature 'PqConnection,SQL' dbUnquoteIdentifier(conn, x, ...)

Arguments

  • conn: A PqConnection created by dbConnect()
  • x: A character vector to be quoted.
  • ...: Other arguments needed for compatibility with generic (currently ignored).

Examples

library(DBI) con <- dbConnect(RPostgres::Postgres()) x <- c("a", "b c", "d'e", "\\f") dbQuoteString(con, x) dbQuoteIdentifier(con, x) dbDisconnect(con)
  • Maintainer: Kirill Müller
  • License: MIT + file LICENSE
  • Last published: 2025-02-25