[postgis-users] Bytea data type and its application and uses

Shaozhong SHI shishaozhong at gmail.com
Fri Sep 18 03:17:09 PDT 2020

Hi,  Giuseppe,

Thank you for your reply.

We know those literature.  The issue is that there is a lack of working
examples to demonstrate its use.

Let's say that people are using PowerBI, Graphic Packages, GIS application
users and etc.  Can these packages access and retrieve image data (Bytea)
from PostGIS?



On Fri, 18 Sep 2020 at 11:07, Giuseppe Broccolo <g.broccolo.7 at gmail.com>

> Hi Shao,
> What do you need to store, more specifically? Since this is a PostGIS
> related thread, is it about raster data, etc.?
> Anyway, as a general info about binary data: there are two general ways to
> insert binaries into a PostgreSQL database, the hex format and the escape
> format. I attach here the reference:
> https://www.postgresql.org/docs/12/datatype-binary.html
> As a personal experience, I used the hexadecimal format: the idea is to
> convert the binary blob into hex digits representation, where one digit
> represents an hex nibble, and each byte of the binary blob is converted
> into two digits, with the most significant nibble first. Then the hex
> digits can be inserted as you would insert a string, preceded with the
> char  \x.
> Depending on what you use at the application side, there are different
> ways of encoding a binary blob into hex format. If you want to try
> something "manually" from a file using psql, try with utilities like
> hexdump, keeping in mind that the binary content in the file is encoded
> using the platform's endianness, i.e. with the most significant nibble put
> for first or for last (check this from your OS).
> Hope it helped,
> Giuseppe.
> Il giorno gio 17 set 2020 alle ore 20:58 Shaozhong SHI <
> shishaozhong at gmail.com> ha scritto:
>> We can see various publications on the Bytea data type.
>> However, it is difficult to find practical examples of how to use it.
>> Anyone knows?
>> Regards,
>> Shao
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200918/cd813f53/attachment.html>

More information about the postgis-users mailing list