Re: convert custom datatype to array

From: Mike Charnoky <noky(at)nextbus(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: convert custom datatype to array
Date: 2007-11-19 16:17:44
Message-ID: 4741B728.5090004@nextbus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks! That did the trick. For posterity, I was able to do the final
conversion using:

alter table mytable alter column mycolumn type float4[] using
string_to_array(trim(both '[]' from
textin(nbf4a_out(mycolumn))),',')::float4[];

Mike

Alvaro Herrera wrote:
> Mike Charnoky wrote:
>> OK, forgive my ignorance here, but the maintainer of our custom data
>> type code is no longer with us and this is new territory for me. We do
>> have a function which takes our custom data type and returns a cstring.
>> Is there a pg function which converts a cstring to text type? This
>> seems to be the missing link to eventually get the data to float4[].
>
> Sure, textin() does that.
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-11-19 16:47:34 Re: Substitute column in SELECT with static value? (Crosstab problem?)
Previous Message Josh Harrison 2007-11-19 16:15:08 Postgresql storage question