Skip site navigation (1) Skip section navigation (2)

Re: C Function returning a tuple with a float4 array as column

From: Tim <tim(dot)child(at)comcast(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: C Function returning a tuple with a float4 array as column
Date: 2010-12-06 13:44:36
Message-ID: (view raw or whole thread)
Lists: pgsql-novice

Thanks  for the feedback. To clarify,   don't need to return multiple 
rows, just  a single   row   which  is a  composite type that contains 
multiple arrays. My apologies  for using the incorrect terminology.      
I  have successfully  written  individual   functions to return arrays 
and  to return composites.  The function to return a composite  type  
used the SRF functions with a row count of 1.

  So  re-phrasing  my question what  would the code sequence look like 
to return a  single  composite type, that contained 1 or more arrays?



On 12/5/2010 1:03 PM, Tom Lane wrote:
> I wrote:
>> ... But what seems likely to be the problem is that
>> you've declared the function to return set (that's implied by the
>> RETURNS TABLE syntax) but not coded it to do any such thing.  I'm
>> guessing some piece of code is confused by the function's failure to
>> follow the SRF API.
> No, scratch that: the problem is with that syntax, but in the columns
> direction not the rows direction.  Since you've only got one column,
> the TABLE syntax degenerates to one OUT param, which is treated as
> though it were just the normal function result.  IOW, this function
> shouldn't be returning a tuple at all, but just the array datum.
> 			regards, tom lane

In response to


pgsql-novice by date

Next:From: mikeDate: 2010-12-06 14:43:06
Subject: Re: Duplicate data within tables
Previous:From: Machiel RichardsDate: 2010-12-06 09:02:57
Subject: Duplicate data within tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group