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

Re: Functions returns to libpq with wrong column split

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Halsall <halsall_andy(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Functions returns to libpq with wrong column split
Date: 2011-10-18 23:45:48
Message-ID: 27718.1318981548@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Andy Halsall <halsall_andy(at)hotmail(dot)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 WHERE r.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

In response to

Responses

pgsql-novice by date

Next:From: Andy HalsallDate: 2011-10-19 08:45:38
Subject: Re: Functions returns to libpq with wrong column split
Previous:From: Dournaee, BlakeDate: 2011-10-18 19:41:52
Subject: enterprise support

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