Re: Functions returns to libpq with wrong column split - Mailing list pgsql-novice

From Tom Lane
Subject Re: Functions returns to libpq with wrong column split
Date
Msg-id 27718.1318981548@sss.pgh.pa.us
Whole thread Raw
In response to Functions returns to libpq with wrong column split  (Andy Halsall <halsall_andy@hotmail.com>)
Responses Re: Functions returns to libpq with wrong column split
List pgsql-novice
Andy Halsall <halsall_andy@hotmail.com> writes:
> My stored procedure looks like this:

>  CREATE OR REPLACE FUNCTION readnode4(bigint) RETURNS  appexcatdata AS '
>  declare
>  h appexcatdata;
>  begin
>  select INTO h r.user_data, n.system_data FROM relationship r INNER JOIN node_system n ON n.node_id =  r.node_id
WHEREr.node_id = $1 LIMIT 1; 
>  RETURN h;
>  end
>  '
>  language 'plpgsql';

[ which is queried as ]

>                            "SELECT readnode4($1)",

I think you probably want "SELECT * FROM readnode4($1)".  As-is,
you're getting a single composite-type column from the SELECT.

            regards, tom lane

pgsql-novice by date:

Previous
From: Andy Halsall
Date:
Subject: Functions returns to libpq with wrong column split
Next
From: Andy Halsall
Date:
Subject: Re: Functions returns to libpq with wrong column split