Re: Function is called multiple times in subselect

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Campbell <chris(at)bignerdranch(dot)com>
Cc: PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>, Don Marco <mark(at)bignerdranch(dot)com>, Aaron Hillegass <aaron(at)bignerdranch(dot)com>
Subject: Re: Function is called multiple times in subselect
Date: 2004-03-12 04:02:21
Message-ID: 4690.1079064141@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Chris Campbell <chris(at)bignerdranch(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2004-03-12 04:27:20 Re: BUG #1096: pg_restore cannot restore large objects with
Previous Message Chris Campbell 2004-03-12 01:29:10 Function is called multiple times in subselect