From: | Andreas Joseph Krogh <andreas(at)visena(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: BLOBs |
Date: | 2016-01-17 22:08:06 |
Message-ID: | VisenaEmail.a5.57089a2d41817e3c.152519d26b3@tc7-visena |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
På søndag 17. januar 2016 kl. 20:26:34, skrev Eugene Yin <eugeneymail(at)ymail(dot)com
<mailto:eugeneymail(at)ymail(dot)com>>:
BLOB binary large object see Large Object Support
<http://www.postgresql.org/docs/current/static/largeobjects.html>
* Minuses
* 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
<http://www.postgresql.org/message-id/20150129142450.b83ce5d0652c39791292d0d5@potentialtech.com>
(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).
https://wiki.postgresql.org/wiki/BinaryFilesInDB
<https://wiki.postgresql.org/wiki/BinaryFilesInDB>
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
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Joseph Krogh | 2016-01-17 22:09:23 | Re: BYTEA |
Previous Message | Adrian Klaver | 2016-01-17 20:29:08 | Re: BYTEA |