pgAdmin III: How to view a blob?

Haroldo_OK picture Haroldo_OK · Feb 14, 2013 · Viewed 26.1k times · Source

I understand that PostgreSQL writes BLOB content to a separate table, but is there any way to view the blob contents in an easy and convenient way from inside pgAdmin?

Answer

Stupidfrog picture Stupidfrog · May 25, 2015
SELECT encode(blobdata::bytea, 'escape') FROM table as o where o.blobdata != ''

where

  1. blobdata is the bytea column (blob)
  2. "table" is the table that contains the column blobdata