SQL functions - bug?

Поиск
Список
Период
Сортировка
От Kovacs Zoltan Sandor
Тема SQL functions - bug?
Дата
Msg-id Pine.LNX.4.05.10006051019070.19686-100000@pc10.radnoti-szeged.sulinet.hu
обсуждение исходный текст
Ответы [OT] Book on Postgres (Not a question)  (Poet/Joshua Drake <poet@linuxports.com>)
Re: SQL functions - bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Behr
Дата:
Сообщение: Re: Default timestamp value
Следующее
От: Allan Kelly
Дата:
Сообщение: cron job INSERT appears to bail.