# File lib/dbd_pg/Pg.rb, line 552 def __blob_read(oid, length=nil) # TODO: do we really nead an open transaction for reading? start_transaction unless @in_transaction blob = @connection.lo_open(oid.to_i, PGlarge::INV_READ) blob.open if length.nil? data = blob.read else data = blob.read(length) end blob.close data rescue PGError => err raise DBI::DatabaseError.new(err.message) end