From: Radosław Smogura <rsmogura@softperience.eu>
To: Alban Hertroys <haramrae@gmail.com>
Cc: Stefan Keller <sfkeller@gmail.com>
Cc: pgsql-general List <pgsql-general@postgresql.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Binary Large Objects (LOB/BLOB) in Hibernate and JDBC: Unresolved issues
Date: Mon, 09 Jan 2012 18:57:39 +0100
Message-ID: <1472223.7TltgQ0Nt7@localhost> (raw)
In-Reply-To: <CAF-3MvO2eR12539YFJP+9BXEEkgfix3rH1QrnxaaOC6iaw952Q@mail.gmail.com>
References: <CAFcOn2-bkFBdBUTa-dRudE0gC6bJbPNVDEV-+LOs40PaDHUhUQ@mail.gmail.com>
<f03d2d0175ac9ef189bc08893eca7b96@mail.softperience.eu>
<CAF-3MvO2eR12539YFJP+9BXEEkgfix3rH1QrnxaaOC6iaw952Q@mail.gmail.com>
Dnia poniedziałek, 9 stycznia 2012 o 15:52:23 Alban Hertroys napisał(a):
> On 9 January 2012 14:55, Radosław Smogura <rsmogura@softperience.eu> wrote:
> > So responsible for this is database, but database doesn't have
> > "real" BLOBs, this what is made in PG JDBC driver is just "not perfect"
> > way to add this functionality to PostgreSQL.
>
> I think you should elaborate on what you mean when you say that
> Postgres doesn't have "real" BLOBs.
>
> This discussion did make me wonder about something in Postgres'
> LOB-support though. As explained earlier, the current implementation
> allows for dedubbing LOB's, so that it's not necessary to store the
> same large(!) object multiple times. That is also what's causing this
> issue with the JDBC driver, or perhaps Hybernate in particular.
>
> However, shouldn't it be up to the application designer to dedup large
> objects or not?
>
> The current implementation is probably rather convenient for projects
> where duplicate large objects are common, but - as it turns out - it
> can be quite inconvenient when that's opposite to expectations.
>
> ISTMT this behaviour should at least be optional. Of course that
> raises the question what should happen with an existing set of LOB's
> when that setting gets changed.
In real world BLOBs are transfered as references, and those references are
managed in way as the trigger does. Nacked PG doesn't support deletion, Oid is
universal type so it can't be used by GC approach, unles collector will know
which Oid is LOB oid.
Oid is like void*, it's abstarct pointer. If you get void* you don't know if
data referenced by it represent person row, or car row, you don't know if
void* is even reference or just 64 bit number. Current implementation is not
type safe. You can't just write UPDATE TABLE x SET blob = 'aadfasfasfda' which
in current times should be supported, but you may write (if are not fully
familiar with db) UPDATE table X set varchar_d = blob_column;
In fact LOB's id may be stored even as varchar. So true is that PG supports
LOBs, but due to missing functionality LOBs are quite hard to manage. It's
like car withot steering wheel - you may drive, but it's little bit hard.
Regards,
Radek
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: rsmogura@softperience.eu, haramrae@gmail.com, sfkeller@gmail.com, pgsql-general@postgresql.org
Subject: Re: Binary Large Objects (LOB/BLOB) in Hibernate and JDBC: Unresolved issues
In-Reply-To: <1472223.7TltgQ0Nt7@localhost>
References: <CAFcOn2-bkFBdBUTa-dRudE0gC6bJbPNVDEV-+LOs40PaDHUhUQ@mail.gmail.com> <f03d2d0175ac9ef189bc08893eca7b96@mail.softperience.eu> <CAF-3MvO2eR12539YFJP+9BXEEkgfix3rH1QrnxaaOC6iaw952Q@mail.gmail.com> <1472223.7TltgQ0Nt7@localhost>
* 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