Question

Im using LargeObjectManager in C# for storage file in database, and do the job like a charm, but im not sure how it works, where the data is located, how can i retreive a list of all storaged files... I just what to know if is the best choice for my requeriments.

Im using something like this:

For saving the file:

var lom = new LargeObjectManager(conn);

noid = lom.Create(LargeObjectManager.READWRITE);
var lo = lom.Open(noid, LargeObjectManager.READWRITE);

lo.Write(largeFile);
lo.Close();

For get the file:

var lom = new LargeObjectManager(conn);
var lo = lom.Open(noid, LargeObjectManager.READWRITE);
return lo.Read(lo.Size());

For delete:

DeleteLargeObject(noid);
Was it helpful?

Solution

PostgreSQL has support for out-of-line blobs, which it refers to as "large objects".

Such files are split up into small chunks (half a page, IIRC), and Pg can do random I/O on them. It's sort of a primitive transactional filesystem built on top of a database table, with simple permissions and all.

The main PostgreSQL documentation, linked above, provides much more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top