SQL functions - bug? - Mailing list pgsql-sql

From Kovacs Zoltan Sandor
Subject SQL functions - bug?
Date
Msg-id Pine.LNX.4.05.10006051019070.19686-100000@pc10.radnoti-szeged.sulinet.hu
Whole thread Raw
Responses [OT] Book on Postgres (Not a question)  (Poet/Joshua Drake <poet@linuxports.com>)
Re: SQL functions - bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
I realized the following facts using SQL language functions:

There is a function "function_y(...)" which returns int4; a table z and
two functions:

CREATE FUNCTION function_x1() RETURNS int4 AS '
select function_y(any_of_fields_of_table_z) from z;
' LANGUAGE 'SQL';

This calls function_y(...) only with the first row of the query output of
the select statement. Instead of this,

CREATE FUNCTION function_x2() RETURNS int4 AS '
select function_y(z_field_any) from z;
select 1;
' LANGUAGE 'SQL';

works properly (the important thing for me is to call function_y with
all rows of the select query). So, the second workaround is OK, but in my
opinion function_x1() also should call function_y(...) for as many rows as
exist in the output. Is this a bug?

I am using 7.0 (8th May).

Regards,
Zoltan



pgsql-sql by date:

Previous
From: Thomas Behr
Date:
Subject: Re: Default timestamp value
Next
From: Allan Kelly
Date:
Subject: cron job INSERT appears to bail.