Skip to content

Instantly share code, notes, and snippets.

@sureshdsk
Last active November 2, 2021 15:23
Show Gist options
  • Save sureshdsk/ccf281b2a89a0bc64d9b9ec9dc8e6f5d to your computer and use it in GitHub Desktop.
Save sureshdsk/ccf281b2a89a0bc64d9b9ec9dc8e6f5d to your computer and use it in GitHub Desktop.
pg_lo_example.sql
# https://www.postgresql.org/docs/14/lo-funcs.html
INSERT INTO image (name, raster)
VALUES ('rich_python', lo_import('/Users/dsk/Downloads/rich_python.png'));
SELECT lo_export(image.raster, '/Users/dsk/Downloads/lo_export/rich_python1.png') FROM image
WHERE name = 'rich_python';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment