Hi,

I'm doing a lot with arrays to get some list values of subselects in requests.

Usually this works fine and I get Perl array back.

But when selecting an user defined type this does not work.

An example:


 SELECT col_1,
        col_2,
        ARRAY( SELECT id FROM other_table WHERE ....)
   FROM table
  WHERE ...;


Works fine; I get an Perl array of the IDs in the subselect.


But when I use user defined type, this does not work:

 SELECT col_1,
        col_2,
        ARRAY( SELECT (text, id)::mytype FROM other_table WHERE ....)
   FROM table
  WHERE ...;


Then I get the Postgres Array String back:

{"(bla,10002)","(bla,10003)","(bla,10001)","(bla,10005)"}


I tried to set an "PG_ANYARRAY" or "PG_TEXTARRAY" type manually with ->bind_col(), but this does not help.


Any ideas how I can get an array for this?

Or is there a PostgreSQL Array parser? ;-)


Ciao
 Alvar


--
** Alvar C.H. Freude, http://alvar.a-blast.org/
** http://www.assoziations-blaster.de/
** http://www.wen-waehlen.de/
** http://www.perl-blog.de/

Attachment: pgpqvVkJ7gNZU.pgp
Description: PGP signature

Reply via email to