PgDAC
Retrieves TBlob object for a field or current record when its name is known.
TMemDataSet
function GetBlob(const FieldName: string): TBlob; overload;
PgQuery1.GetBlob('Comment').SaveToFile('Comment.txt');