Array question
Alvar Freude <alvar-8X5/[email protected]>
| Newsgroups | gmane.comp.db.postgresql.dbdpg |
|---|---|
| Message-ID | <[email protected]> |
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/
signature.asc
(application/pgp-signature, 194 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkqls24ACgkQOndlH63J86xL4gCeNwecsiOeaGncz/69lxm5NOJ/ p1EAnA8/6OwsrAfN85Zmvbp/j69ClnBf =ta+R -----END PGP SIGNATURE-----