Thank you very much , your suggestion
helped a lot
But, I have a bit more of a challenge now,
my array is being generated by the 'client' (it is not in the database)
so I am trying to employ your method on
'string'
but running into a problem as I cannot typecast correctly
select V[i][j]
FROM
(select '{{A,B,C},{D,E,F}}') as V
CROSS JOIN generate_series(1, 3) i
CROSS JOIN generate_series(1,2) j
Does not work, because V is not an array (it is a string)
and I do not know where to put the typecast
::text[][]
anywhwere I tried I get syntax error
thank you in advance for help
>
> On Wed, 12 Aug 2009 20:52 -0700, "Scott Bailey" <artacus@comcast.net>
> wrote:
> > V S P wrote:
> > > if I have field declared
> > > myvalue text[][]
> > >
> > > insert into vladik (myval)
> > > values
> > > (
> > > '{{"\",A", "\"B"}, {"Y", "Q"}}'
> > > )
> > >
> > >
> > > What do you guys use in your treasurechest of 'addons'
> > > to successfully parse out the above trickery
> > > and get
> > >
> > > and get the 4 strings
> > > ",A
> > > "B
> > > Y
> > > Q
> > >
> > > from within Postgres stored procedure as well as C++ or other client
> > > code.
> > >
> > >
> > > It seems to me that it is not possible with any built-in command
> > > available
> > > to easily extract the strings out to a multidimensional array
> >
> >
> > Actually its pretty easy.
> >
> > SELECT myval[i][j]
> > FROM vladik
> > CROSS JOIN generate_series(1, array_upper(myval, 1)) i
> > CROSS JOIN generate_series(1, array_upper(myval, 2)) j
> >
--
Vlad P
author of C++ ORM http://github.com/vladp/CppOrm/tree/master
--
http://www.fastmail.fm - Accessible with your email software
or over the web