pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@postgresql.org
Subject: Re: Binary Large Objects (LOB/BLOB) in Hibernate and JDBC: Unresolved issues
Date: Sun, 08 Jan 2012 18:43:04 +0100
Message-ID: <jeckhp$q0d$1@dough.gmane.org> (raw)
In-Reply-To: <CAFcOn2-bkFBdBUTa-dRudE0gC6bJbPNVDEV-+LOs40PaDHUhUQ@mail.gmail.com>
References: <CAFcOn2-bkFBdBUTa-dRudE0gC6bJbPNVDEV-+LOs40PaDHUhUQ@mail.gmail.com>

Stefan Keller wrote on 06.01.2012 19:04:
> I maintain images (from Webcams). In the Java and Hibernate (JPA) code
> I specified a @Lob annotation on class MyData and a attribte/data type
> "byte[] mydata;". Hibernate then generates two tables in PostgreSQL,
> one called MyData with a column mydata of type oid and an internal one
> called pg_largobjects (which contain foreign keys to the oid). That's
> also explained in the JDBC docs [1], saying "PostgreSQL provides two
> distinct ways to store binary data. Binary data can be stored in a
> table using the data type bytea or by using the Large Object feature
> which stores the binary data in a separate table in a special format
> and refers to that table by storing a value of type oid in your
> table."

I think you are better off using bytea unless you need to access only parts of the blob regularly.






view thread (25+ messages)  latest in thread

Message-ID: <jeckhp$q0d$1@dough.gmane.org>
Permalink:  ../jeckhp$q0d$1@dough.gmane.org/
Also on:    postgresql.org/message-id/jeckhp$q0d$1@dough.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: spam_eater@gmx.net, pgsql-general@postgresql.org
  Subject: Re: Binary Large Objects (LOB/BLOB) in Hibernate and JDBC: Unresolved issues
  In-Reply-To: <jeckhp$q0d$1@dough.gmane.org>
  References: <CAFcOn2-bkFBdBUTa-dRudE0gC6bJbPNVDEV-+LOs40PaDHUhUQ@mail.gmail.com> <jeckhp$q0d$1@dough.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox