Hi! Working with BLOBs in PSQL is currently easy (substring, concatenate, etc), but it's limited and sometimes very expensive.
If you concatenate a blob in a loop database grows a lot as intermediary blobs are created and we can't even manually choose database/temp page space. I propose system package RDB$BLOB_UTIL for blob manipulation in PSQL. RDB$BLOB_UTIL will have procedures and functions so blobs could be created, opened, read in chunks, written in chunks, discarded (cancel). Blob creation will accept parameter to create in database or temporary space. They will work with blob handles (a new term just to differentiate from blob ids) which will be put on a transaction map in engine memory. The map consists of a (unsigned id, blb* blob). Here a small example of how it could be used for writing data in chunks: -------- execute block returns (b blob) as declare handle integer; begin handle = rdb$blob_util.new(); rdb$blob_util.append(handle, '12345'); rdb$blob_util.append(handle, '67'); b = rdb$blob_util.make(handle); suspend; end! -------- Adriano Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel