Re: Convert of string to array problem - Mailing list pgsql-general

From Thom Brown
Subject Re: Convert of string to array problem
Date
Msg-id t2ibddc86151004290552w2f791ee6jcc9572e62e829cb8@mail.gmail.com
Whole thread Raw
In response to Convert of string to array problem  (Bård Grønbech <baard.gronbech@gmail.com>)
Responses Re: Convert of string to array problem  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
On 29 April 2010 13:35, Bård Grønbech <baard.gronbech@gmail.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

pgsql-general by date:

Previous
From:
Date:
Subject: Re: FW: Java Memory Issue while Loading Postgres library
Next
From: Merlin Moncure
Date:
Subject: Re: Problem: concat an array of arrays