Getting real arrays from array fields in Perl
От | Alvar Freude |
---|---|
Тема | Getting real arrays from array fields in Perl |
Дата | |
Msg-id | 3A11A99B.D3A0D0BE@merz-akademie.de обсуждение исходный текст |
Список | pgsql-interfaces |
Hello, i have created a table containing arrays like this: CREATE TABLE arraytest ( id SERIAL, array int8[], value text ) I use the DBI interface in Perl to handle the database. If i select arrays in the database, it returns strings instead of real Perl array refereneces: my $arrayref = $db_p->selectall_arrayref("SELECT * FROM arraytest"); use Data::Dumper; print Dumper($arrayref); The result is: $VAR1 = [ [ 1, '{23,24,25,26}', 'foo' ], [ 2, '{1,2,3,4}', 'bar' ] ]; I want a structure containing real arrayrefs like this: $VAR1 = [ [ 1, [ 23,24,25,26 ], 'foo' ], [ 2, [ 1,2,3,4 ], 'bar' ] ]; Is there an option to get the desired behaviour? I couldn't find anything in the documentation of Postgres and DBD::Pg. Thank you Alvar -- Alvar C.H. Freude | alvar.freude@merz-akademie.de Demo: http://www.online-demonstration.org/ | Mach mit! Blast-DE: http://www.assoziations-blaster.de/ | Blast-Dich-Fit Blast-EN: http://www.a-blast.org/ | Blast/english
В списке pgsql-interfaces по дате отправления: