Re: SRF Functions don't want to return empty tuple

From: "GRIMOIS Eric" <eric(dot)grimois(at)cpam-cergypontoise(dot)cnamts(dot)fr>
To: "Stephan Szabo" <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SRF Functions don't want to return empty tuple
Date: 2003-09-29 17:12:08
Message-ID: 008801c386ac$d08b68c0$3d04a837@cpamcergypontoise.cnamts.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

----- Original Message -----
From: "Stephan Szabo" <sszabo(at)megazone(dot)bigpanda(dot)com>
To: "GRIMOIS Eric" <eric(dot)grimois(at)cpam-cergypontoise(dot)cnamts(dot)fr>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Monday, September 29, 2003 6:40 PM
Subject: Re: [SQL] SRF Functions don't want to return empty tuple

>
> On Mon, 29 Sep 2003, GRIMOIS Eric wrote:
>
> > Hi
> >
> > I have a problem with SRF functions on a RedHat 8.0 system with
PostgreSQL
> > 7.3.2.
> >
> > Schema is following :
> >
> > CREATE TABLE public.agents (
> > numero_age int4 NOT NULL,
> > nom_age varchar(30) NOT NULL,
> > prenom_age varchar(30) NOT NULL,
> > date_entree_age date NOT NULL,
> > identite varchar(50),
> > CONSTRAINT agents_pkey PRIMARY KEY (numero_age)
> > ) WITH OIDS;
> >
> > INSERT INTO public.agents VALUES (78888, 'PERAVIF', 'JO', '1967-06-18',
'')
> >
> > CREATE FUNCTION public.liste_agents(int4) RETURNS public.agents AS
'SELECT *
> > FROM agents WHERE numero_age = $1' LANGUAGE 'sql' VOLATILE;
>
> Are you sure you don't want setof public.agents if you want to be able to
> return an empty set?
>

Yes, you're right. Now, it works.

Thank you very much

The syntax I used was wrong, but is accepted by Postgres. What does it mean
?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-09-29 17:15:03 Re: Need to overcome UNION / ORDER BY restriction
Previous Message Josh Berkus 2003-09-29 17:09:31 Re: postgres index on ILIKE