Re: [GENERAL] could not find array type for data type character varying[]

2009-10-28 Thread Merlin Moncure
On Wed, Oct 28, 2009 at 11:17 AM, Viktor Rosenfeld wrote: > Hi, > > I'm trying to aggregate a list of table attributes into an array. > > The actual code looks something like this: > >  SELECT >    node_ref AS id, >    array_agg(DISTINCT ARRAY[namespace, name, value]) as annotations >  ... >  GROU

Re: [GENERAL] could not find array type for data type character varying[]

2009-10-28 Thread Sam Mason
On Wed, Oct 28, 2009 at 04:17:32PM +0100, Viktor Rosenfeld wrote: > I'm trying to aggregate a list of table attributes into an array. I'd suggest using a tuple, arrays for things where each element means the same thing. I'd guess you care about the substructure (i.e. the element has a "namespace"

Re: [GENERAL] could not find array type for data type character varying[]

2009-10-28 Thread Tom Lane
Viktor Rosenfeld writes: > annis=> select array_agg(array['a'::varchar, 'b', 'c']); > ERROR: could not find array type for data type character varying[] > Why doesn't this work? The output of array_agg would have to be an array whose elements are array-of-varchar. Which is a datatype we do