Re: SRF Functions don't want to return empty tuple
От | Stephan Szabo |
---|---|
Тема | Re: SRF Functions don't want to return empty tuple |
Дата | |
Msg-id | 20030929112022.O94710@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | Re: SRF Functions don't want to return empty tuple ("GRIMOIS Eric" <eric.grimois@cpam-cergypontoise.cnamts.fr>) |
Список | pgsql-sql |
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.
В списке pgsql-sql по дате отправления: