Re: stable function called for every row? - Mailing list pgsql-general

From Gerhard Heift
Subject Re: stable function called for every row?
Date
Msg-id 20090107201604.GC21538@kawo1.rwth-aachen.de
Whole thread Raw
In response to stable function called for every row?  (Gerhard Heift <ml-postgresql-20081012-3518@gheift.de>)
Responses Re: stable function called for every row?  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-general
I isolated my problem a little bit:

CREATE FUNCTION get_array() RETURNS integer[] AS
$BODY$
BEGIN
  RAISE INFO 'get_array';
  RETURN ARRAY[1, 2];
END
$BODY$ LANGUAGE 'plpgsql' STABLE;

And now

SELECT * FROM generate_series(1,3) a(b) where array[b] <@ core.get_array();

gives me:

INFO:  get_array
INFO:  get_array
INFO:  get_array
 b
---
 1
 2
(2 rows)

Why?? Wlli functions which returns an array not be cached?

Regards,
  Gerhard

Attachment

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: encoding of PostgreSQL messages
Next
From: Kirk Strauser
Date:
Subject: Re: FreeBSD and large shared_buffers a no-go?