Re: Function is called multiple times in subselect - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Function is called multiple times in subselect
Date
Msg-id 4690.1079064141@sss.pgh.pa.us
Whole thread Raw
In response to Function is called multiple times in subselect  (Chris Campbell <chris@bignerdranch.com>)
Responses Re: Function is called multiple times in subselect
List pgsql-bugs
Chris Campbell <chris@bignerdranch.com> writes:
> I don't think this should be happening (PostgreSQL 7.4.1).

Sorry, this isn't a bug.  Flattening the subquery is generally desirable
behavior.

I think the easiest way to force the subquery not to be flattened is to
insert a LIMIT or OFFSET clause, viz

    SELECT ... FROM (SELECT ... OFFSET 0) query;

            regards, tom lane

pgsql-bugs by date:

Previous
From: Chris Campbell
Date:
Subject: Function is called multiple times in subselect
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #1096: pg_restore cannot restore large objects with