Re: BYTEA: PostgreSQL 9.1 vs 9.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Carel Combrink <carel(dot)combrink(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: BYTEA: PostgreSQL 9.1 vs 9.3
Date: 2014-01-30 15:28:04
Message-ID: 31756.1391095684@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Carel Combrink <carel(dot)combrink(at)gmail(dot)com> writes:
> I am using a PostgreSQL 9.1 server and the following query is perfectly
> valid for a BYTEA type column:
> INSERT INTO files VALUES(18,'\x536f6d6520746573742062797465206172726179');

> But for a server running version 9.3 the above query fails with the
> following error:
> ERROR: array value must start with "{" or dimension information
> LINE 1: insert into files values(18,'\x504b030414000600080000002100e...

Works for me:

$ psql
psql (9.3.2)
Type "help" for help.

regression=# create table files (f1 int, f2 bytea);
CREATE TABLE
regression=# INSERT INTO files VALUES(18,'\x536f6d6520746573742062797465206172726179');
INSERT 0 1
regression=# select * from files;
f1 | f2
----+--------------------------------------------
18 | \x536f6d6520746573742062797465206172726179
(1 row)

Evidently there's some relevant detail you're not telling us.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message James David Smith 2014-01-30 15:28:44 Re: Update with last known location?
Previous Message Erik Darling 2014-01-30 15:24:24 Re: Update with last known location?