Thread: changing from postgreSQL 8.3 to 9.0

changing from postgreSQL 8.3 to 9.0

From
Malm Paul
Date:
Hi,
I have a database created on ver 8.3 an have restored the database in a new database in PostgreSQL 9.0.
In the database i'm using a column storing "bytea".
 
When trying to read the database with my java application, I have problems reading from the bytea-stream.
Integers read is not correct. I can see that there is something new in ver 9.0: LC_COLLATE. Has that someting to do with my problem reading from "bytea".
If so, what is the easiest way to get around this problem, when importing the database that is created in PostgreSQL 8.3?
 
Kind regards,
Paul
 

Re: changing from postgreSQL 8.3 to 9.0

From
Andreas Kretschmer
Date:
Malm Paul <paul.malm@saabgroup.com> wrote:

> Hi,
> I have a database created on ver 8.3 an have restored the database in a new
> database in PostgreSQL 9.0.
> In the database i'm using a column storing "bytea".
>
> When trying to read the database with my java application, I have problems
> reading from the bytea-stream.

You can set bytea_output from 'hex' (now default) to 'escape'
(traditional format). You can do that in the postgresq.conf (for the
whole cluster), via ALTER DATABASE or per session.


HTH.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: changing from postgreSQL 8.3 to 9.0

From
"Albe Laurenz"
Date:
Malm Paul wrote:
> I have a database created on ver 8.3 an have restored the database in
a new database in PostgreSQL
> 9.0.
> In the database i'm using a column storing "bytea".
>
> When trying to read the database with my java application, I have
problems reading from the bytea-
> stream.
> Integers read is not correct. I can see that there is something new in
ver 9.0: LC_COLLATE. Has that
> someting to do with my problem reading from "bytea".
> If so, what is the easiest way to get around this problem, when
importing the database that is created
> in PostgreSQL 8.3?

Collation or encoding matter only for textual data, not for binary data.

Did you update your JDBC driver to a version that supports 9.0?

With an old JDBS driver, you might have problems with the new
bytea encoding format in 9.0. You can test by setting
bytea_output to "escape" in postgresql.conf and see if that
works around the problem.

Yours,
Laurenz Albe