From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: GRIMOIS Eric <eric.grimois@cpam-cergypontoise.cnamts.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: SRF Functions don't want to return empty tuple
Date: Mon, 29 Sep 2003 11:21:14 -0700 (PDT)
Message-ID: <20030929112022.O94710@megazone.bigpanda.com> (raw)
In-Reply-To: <008801c386ac$d08b68c0$3d04a837@cpamcergypontoise.cnamts.fr>
References: <003901c386a5$409c0b40$3d04a837@cpamcergypontoise.cnamts.fr>
<20030929093850.X92835@megazone.bigpanda.com>
<008801c386ac$d08b68c0$3d04a837@cpamcergypontoise.cnamts.fr>
On Mon, 29 Sep 2003, GRIMOIS Eric wrote:
> > On Mon, 29 Sep 2003, GRIMOIS Eric wrote:
> >
> > > 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
IIRC it means it returns exactly one object of the type defined by
agents.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone.bigpanda.com, eric.grimois@cpam-cergypontoise.cnamts.fr
Subject: Re: SRF Functions don't want to return empty tuple
In-Reply-To: <20030929112022.O94710@megazone.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox