On Mon, Feb 2, 2009 at 2:30 PM, Scara Maccai <m_lists@xxxxxxxx> wrote: > Paolo Saudin wrote: >> I use a master table with a "fulldate" field and filled with sequential dates to >> fill gaps when meteo data is missing. > > I'm sorry, I still don't get it: how can you be sure that postgresql won't call perl_sliding_mean with not-ordered timestamps-data? I don't mean only in case of holes. > > The "order by" as far as I know is usually done at the very end of the plan, so I don't think it can affect the order of the data passed to the function... You need to make a subquery with the ORDER BY on it. Postgres won't re-order an ORDER BY in a subquery to happen outside the outer query. So something like select perl_function(foo) from (select foo from table order by bar) -- greg -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general