Skip site navigation (1) Skip section navigation (2)

cast bytea to double precision[]

From: Mathieu Dubois <mathieu(dot)dubois(at)limsi(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: cast bytea to double precision[]
Date: 2011-07-24 19:03:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I have a column of type bytea which contains a vector encoded in a 
string (elements are separated by spaces).
The problem is that it uses a lot of storage space.

I would like to convert this column to an ARRAY column with ALTER COLUMN 

If I understand correctly, I have to specify a function to cast bytea to 
double precision[]. Is it correct?

If this is correct, how to do that?

I use regexp_split_to_array to transform the bytea to a text[] but I 
can't figure out how to convert it to double precision[].

I'm using postgres 8.4.

Any idea?

Thanks in advance,

pgsql-novice by date

Next:From: Mathieu DuboisDate: 2011-07-24 19:03:36
Subject: Re: cast bytea to double precision[]
Previous:From: Mathieu DuboisDate: 2011-07-24 18:18:53
Subject: cast bytea to double precision[]

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group