SQL functions - bug?

From: Kovacs Zoltan Sandor <tip(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
To: pgsql-sql(at)postgresql(dot)org
Subject: SQL functions - bug?
Date: 2000-06-05 08:32:59
Message-ID: Pine.LNX.4.05.10006051019070.19686-100000@pc10.radnoti-szeged.sulinet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jean-Marc Libs 2000-06-05 10:47:34 Problem with joins
Previous Message Thomas Behr 2000-06-05 08:13:22 Re: Default timestamp value