Re: BLOBs

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: BLOBs
Дата
Msg-id VisenaEmail.a5.57089a2d41817e3c.152519d26b3@tc7-visena
обсуждение исходный текст
Ответ на Re: BLOBs  (Eugene Yin <eugeneymail@ymail.com>)
Ответы Re: BLOBs
Список pgsql-sql
På søndag 17. januar 2016 kl. 20:26:34, skrev Eugene Yin <eugeneymail@ymail.com>:
 
BLOB binary large object see Large Object Support
 
 
  •  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 (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
 
Вложения

В списке pgsql-sql по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: BYTEA
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: BYTEA