postgresImportLargeObject: Imports a large object from file

View source: R/PqConnection.R

postgresImportLargeObjectR Documentation

Imports a large object from file

Description

Returns an object identifier (Oid) for the imported large object. This function must be called within a transaction.

Usage

postgresImportLargeObject(conn, filepath = NULL, oid = 0)

Arguments

conn

a PqConnection object, produced by DBI::dbConnect()

filepath

a path to the large object to import

oid

the oid to write to. Defaults to 0 which assigns an unused oid

Value

the identifier of the large object, an integer

Examples

## Not run: 
con <- postgresDefault()
filepath <- 'your_image.png'
dbWithTransaction(con, {
  oid <- postgresImportLargeObject(con, filepath)
})

## End(Not run)

RPostgres documentation built on Feb. 6, 2026, 9:07 a.m.