Re: Convert of string to array problem

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Bård Grønbech <baard(dot)gronbech(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Convert of string to array problem
Date: 2010-04-29 12:52:50
Message-ID: t2ibddc86151004290552w2f791ee6jcc9572e62e829cb8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29 April 2010 13:35, Bård Grønbech <baard(dot)gronbech(at)gmail(dot)com> wrote:

> Have a string like '0.1;0.2;null;0.3' which I would like to convert
> into a double precision[] array.
>
> Trying:
>
> select cast (string_to_array('0.1;0.2;null;0.3', ';') as float8[])
>
> gives me an error: invalid input syntax for type double precision: "null".
>
> Can anybody help me?
>
> -Bård
>
>
I believe string_to_array will take that null as a string called 'null',
which it can't convert to a float8.

Regards

Thom

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2010-04-29 12:53:39 Re: Problem: concat an array of arrays
Previous Message A.Bhattacharya 2010-04-29 12:48:14 Re: FW: Java Memory Issue while Loading Postgres library