Re: Function not return zero record

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sylvain Racine <syracine(at)sympatico(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Function not return zero record
Date: 2006-08-03 17:29:26
Message-ID: 44D23276.4090100@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Sylvain Racine wrote:
> Hello,
>
> I wrote a simple function who checks in a table an address and returns
> the id and coordinates of the corresponding address.
>
> The problem is when I run separately the SQL query, it gives me zero (0)
> entry when I submit a new address - it is what I want as result - and
> when I run my function, it gives me 1 entry with the same address.
>
> Note: I create a pseudo-type to return the result. Is that my problem?

The problem is the difference between a value of type getCache and a set
of values of type getCache.

Define your function as returning a SETOF getCache
Call it with SELECT * FROM getCache(...)

HTH

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Hammond 2006-08-03 18:49:31 Re: alter column type from boolean to char with default
Previous Message jason nordwick 2006-08-03 17:04:39 Error: out of memory in create table as