Hi,
I found PostgreSQL have strange behaviour with sub-select and pl/pgSQL,
see the case study at:
http://www.bobson.pl/pgsql/pgsql_sb1.html
I know my version is quite old. Its most new in gentoo (hope 8.2 will be
soon in gentoo portage).
test=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 8.1.5 on i686-pc-linux-gnu, compiled by GCC
i686-pc-linux-gnu-gcc (GCC) 4.1.1 (Gentoo 4.1.1)
regards,
Robert
bobson(at)bobson(dot)pl