PL/pgSQL, RETURN NEXT, ORDER

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 <twanger [at] bluetwanger.de>


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

http://www.postgresql.org/docs/faqs/FAQ.html
twanger [ Di, 12 Oktober 2004 15:24 ] [ ID #453798 ]

Re: PL/pgSQL, RETURN NEXT, ORDER

=D0=92 =D0=92=D1=82=D1=80, 12.10.2004, =D0=B2 15:24, Markus Bertheau =D0=BF=
=D0=B8=D1=88=D0=B5=D1=82:

> 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.

--
Markus Bertheau <twanger [at] bluetwanger.de>


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo [at] postgresql.org
twanger [ Di, 12 Oktober 2004 15:41 ] [ ID #453799 ]
Datenbanken » comp.databases.postgresql.sql » PL/pgSQL, RETURN NEXT, ORDER

Vorheriges Thema: JDBC +CIDR
Nächstes Thema: How do FKs work?