Forum: Ruby on Rails Postgresql array converts to string????

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
sayoyo S. (Guest)
on 2006-02-16 23:55
(Received via mailing list)
Hi

We are using postgresql with rails, we find out that
when we read array from postresql (postgresql support
array type in table) the rails (or postgresql_adapter)
converts the arrays into Strings, example: we have a
data type array in a table which has two cells:
[cell1,cell2], rails will convert them into string
like this {cell1,cell2}. So after received the result
from a SQL request we have convert the string back to
array, it is very time consuming job.

Does anyone know how to keey the arrays????

we are using ruby1.8.4 and rails 1.0 postgres adapter
version 0.7.1

Thanks you very much

Saiho



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
sayoyo S. (Guest)
on 2006-02-17 17:07
(Received via mailing list)
Hi

We are using postgresql with rails, we find out that
when we read array from postresql (postgresql support
array type in table) the rails (or postgresql_adapter)
converts the arrays into Strings, example: we have a
data type array in a table which has two cells:
[cell1,cell2], rails will convert them into string
like this {cell1,cell2}. So after received the result
from a SQL request we have convert the string back to
array, it is very time consuming job.

Does anyone know how to keey the arrays????

we are using ruby1.8.4 and rails 1.0 postgres adapter
version 0.7.1

Thanks you very much

Saiho





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Neil D. (Guest)
on 2006-02-20 02:34
(Received via mailing list)
Saiho Y. wrote:
> array, it is very time consuming job.
>
I just had a simular problem I used the code
<field>.delete('{}').split(',')
to convert an integer array.

Regards Neil
This topic is locked and can not be replied to.