- must use different interface from what is normally used to access BLOBs.
- Need to track OID. Normally a separate table with additional meta data is used to describe what each OID is.
- (8.4 and <8.4) No access controls in database.
- Sometimes advised against (basically you only need them if your entry is so large you need/want to seek and read bits and pieces of it at a time).
Do one really:
- Need to track OID. Normally a separate table with additional meta data is used to describe what each OID is.
Using BLOBs and PG's OIDs is really simple if you use the pgjdbc-ng driver.
You column has to be defined as type=OID, like this
CREATE TABLE my_stuff(
id SERIAL PRIMARY KEY,
data OID
);
Then use the JDBC BLOB-interface as defined.
You don't need to do anything else except running the 'vacuumlo' system-command (not SQL-command) once in a while, preferably using 'cron' or some other scheduling-tool.
Note that "everything" you read about PG and JDBC and BLOB will describe the official JDBC-driver, which doesn't even support BLOBs. So if you just get by that and use the pgjdbc-ng driver your life will be much simpler.
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963