SQL 問い合わせで便利な、lo_import と lo_export という2つの組み込み済みの登録された関数があります。これらの使用例を以下に示します。
CREATE TABLE image (
name text,
raster oid
);
INSERT INTO image (name, raster)
VALUES ('beautiful image', lo_import('/etc/motd'));
SELECT lo_export(image.raster, '/tmp/motd') FROM image
WHERE name = 'beautiful image';