0

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);
Milen A. Radev
  • 60,241
  • 22
  • 105
  • 110
Najera
  • 2,869
  • 3
  • 28
  • 52

1 Answers1

1

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.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778