Thread: How to access arrays from DBD::Pg?

How to access arrays from DBD::Pg?

From
elwood@agouros.de (Konstantinos Agouros)
Date:
Hi,

I have some data, that I would like to store in array-columns. How can I access
this from DBD::Pg? Do I have to parse it manually?

Konstantin
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres

Re: How to access arrays from DBD::Pg?

From
will trillich
Date:
On Sun, May 27, 2001 at 09:39:12PM +0200, Konstantinos Agouros wrote:
> Hi,
>
> I have some data, that I would like to store in array-columns. How can I access
> this from DBD::Pg? Do I have to parse it manually?

that's how i do it. if there's another way i'd love to hear it.

    sub trim { substr(@_[0],1,length(@_[0])-2) };
    my $r = $sth->fetchrow_arrayref();
    # $r->{arraycolumn} resembles {"one","two","three"} --
    my @a = map{ &trim($_) } split /,/, &trim($r->{arraycolumn});
    # presuming no array element contains a comma...!

--
#95: We are waking up and linking to each other. We are watching. But
we are not waiting.  -- www.cluetrain.com

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!