PL/pgSQL, RETURN NEXT, ORDER

PL/pgSQL, RETURN NEXT, ORDER

am 12.10.2004 15:24:48 von twanger

Hi,

When I call a PL/pgSQL function that looks roughly like the following:

....
FOR x IN SELECT ... ORDER BY ... LOOP
RETURN NEXT x;
END LOOP;
RETURN;
END;

Is the order of the rows guaranteed to be preserved?

Thanks.

--
Markus Bertheau


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Re: PL/pgSQL, RETURN NEXT, ORDER

am 12.10.2004 15:41:15 von twanger

В Втр, 12.10.2004, в 15:24, Markus Bertheau п=
ишет:

> Is the order of the rows guaranteed to be preserved?

Neil clarified on IRC that
- there is no interface guarantee
- in the current implementation the order is preserved
- a future implementation is likely to change that

Thanks.

--=20
Markus Bertheau


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org