From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Eugene Yin <eugeneymail(at)ymail(dot)com>, Postgres List <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: BYTEA |
Date: | 2016-01-17 20:29:08 |
Message-ID: | 569BF994.1060909@aklaver.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On 01/17/2016 11:33 AM, Eugene Yin wrote:
> Pg 9.4+
>
> Storing binary data using bytea
> <http://www.postgresql.org/docs/8.4/static/datatype-binary.html> or text
> <http://www.postgresql.org/docs/8.4/static/datatype-character.html> data
> types
>
> * Pluses
> o Storing and Accessing entry utilizes the same interface when
> accessing any other data type or record.
> o No need to track OID of a "large object" you create
> * Minus
> o bytea and text data type both use TOAST
> <http://www.postgresql.org/docs/8.4/static/storage-toast.html>
> (details here <https://wiki.postgresql.org/wiki/TOAST>)
> + limited to 1G per entry
> + 4 Billion (> 2KB) entries per table max
> <https://wiki.postgresql.org/wiki/TOAST>.
> o *Need to escape/encode binary data before sending to DB then do
> the reverse after retrieving the data *
> o Memory requirements on the server can be steep even on a small
> record set.
>
> https://wiki.postgresql.org/wiki/BinaryFilesInDB
>
>
>
> Do I really *Need to escape/encode binary data before sending to DB
> then do the reverse after retrieving the data?*
> *
> *
> If so, what (*Java*) codes should I use to achieve this goal (I am using
> the Java to interface with the DB)?
https://jdbc.postgresql.org/documentation/94/binary-data.html
>
>
>
> Thanks
>
> Eugene
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Joseph Krogh | 2016-01-17 22:08:06 | Re: BLOBs |
Previous Message | Eugene Yin | 2016-01-17 19:33:38 | BYTEA |