On 23/12/2007, Louis-David Mitterrand
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> is there a way to return a Pg array as a list of single-column row
> values?
>
> I am trying to circumvent DBI's lack of support for native database
> arrays and return the list of values from an ENUM as a perl array.
>
> Thanks,
>

you can solve this problem with conversion to string with const separator

Like:

postgres=# select array_to_string(array[1,2,3,4],'|');
 array_to_string
-----------------
 1|2|3|4
(1 row)

[EMAIL PROTECTED] ~]$ perl
@a = split(/\|/, "1|2|3");
print $a[1];

Regards
Pavel

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to