Thread: The bytea datatype and JDBC

The bytea datatype and JDBC

From
Gunnar Rønning
Date:
I saw Tom Lane mentioning the bytea datatype as the way to do BLOBs for
tables, but I cannot find anything on it in the documentation and
it is not supported by the JDBC driver as far as I can see.

Where can I get information about it, so I can go on with implementing support
for it ?

Is there any performance differences between using BLOB/OID and bytea ?

I cannot use the OID approach with the application in question as it is
an JDBC app(Turbine from jakarta.apache.org) that relies on asking the JDBC
driver for the datatype. Doing this for an OID column does ofcourse return
integer while you in some instances would like it to return varbinary.

The Turbine people recommend this patch :
http://jakarta.apache.org/turbine/howto/postgres-howto.html

I don't like this approach as it may break other usages of OID, so hence my
desire to use bytea to get something that works.

Turbine is a quite large and nice web app framework in Java, and it would be
nice to see more Turbine users go from mysql to pgsql. But this issue is
a showstopper for a lot of the people trying...

regards,

        Gunnar

--
Gunnar Rønning - gunnar@polygnosis.com
Senior Consultant, Polygnosis AS, http://www.polygnosis.com/

Re: The bytea datatype and JDBC

From
"Dave Cramer"
Date:
Gunnar,

You should check the README file in the jdbc directory of the source. There
is some discussion about BLOB's in it.

Dave
----- Original Message -----
From: "Gunnar Rønning" <gunnar@polygnosis.com>
To: <pgsql-general@postgresql.org>
Cc: <pgsql-jdbc@postgresql.org>
Sent: Friday, June 15, 2001 12:02 PM
Subject: [JDBC] The bytea datatype and JDBC


> I saw Tom Lane mentioning the bytea datatype as the way to do BLOBs for
> tables, but I cannot find anything on it in the documentation and
> it is not supported by the JDBC driver as far as I can see.
>
> Where can I get information about it, so I can go on with implementing
support
> for it ?
>
> Is there any performance differences between using BLOB/OID and bytea ?
>
> I cannot use the OID approach with the application in question as it is
> an JDBC app(Turbine from jakarta.apache.org) that relies on asking the
JDBC
> driver for the datatype. Doing this for an OID column does ofcourse return
> integer while you in some instances would like it to return varbinary.
>
> The Turbine people recommend this patch :
> http://jakarta.apache.org/turbine/howto/postgres-howto.html
>
> I don't like this approach as it may break other usages of OID, so hence
my
> desire to use bytea to get something that works.
>
> Turbine is a quite large and nice web app framework in Java, and it would
be
> nice to see more Turbine users go from mysql to pgsql. But this issue is
> a showstopper for a lot of the people trying...
>
> regards,
>
>         Gunnar
>
> --
> Gunnar Rønning - gunnar@polygnosis.com
> Senior Consultant, Polygnosis AS, http://www.polygnosis.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>


Re: The bytea datatype and JDBC

From
Gunnar Rønning
Date:
* "Dave Cramer" <Dave@micro-automation.net> wrote:

| Gunnar,
|
| You should check the README file in the jdbc directory of the source. There
| is some discussion about BLOB's in it.

I have read that file already, and I've also been peeking into the source
code, but what I'm intersted in having more portable BLOBs so I can more
easily adapt applications written for other databases to pgsql.

regards,
        Gunnar