Re: mssql to postgres problems with bytea help needed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: mssql to postgres problems with bytea help needed
Date: 2008-03-06 18:06:06
Message-ID: 19027.1204826766@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> robert, 06.03.2008 15:32:
>> I've successfully converted a huge mssql ddl to postgres 8.1.9 - I
>> could upgrade if need be. We run both db's for our app depending on
>> the customer. We have a new feature, storing serialized java objects
>> in the db, and I'm having trouble with on this insert:

> The syntax for specifying "BLOB literals" is a bit different in Postgres. You need to encode the bytes as octal values not hex values.

And you need some quotes, too.

It might make for less change in the application if you use decode() to
convert a hex string to bytea, a la

decode('ACED0005737200286...', 'hex')

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2008-03-06 18:08:40 Re: I'm in need of something that should be there
Previous Message Ralph Smith 2008-03-06 17:52:28 Re: I'm in need of something that should be there