Re: [PERFORM] Query Optimizer Failure / Possible Bug

2005-04-16 Thread Hannes Dorbath
Some people on the #postgresql irc channel pointed out that it's a known issue. http://www.qaix.com/postgresql-database-development/246-557-select-based-on-function-result-read.shtml A more simple testcase is below. Adding OFFSET 0 to the inner query does indeed fix it in my case. SELECT tmp.

Re: [PERFORM] immutable functions vs. join for lookups ?

2005-04-16 Thread Enrico Weigelt
* Tom Lane <[EMAIL PROTECTED]> wrote: > Enrico Weigelt <[EMAIL PROTECTED]> writes: > > c) CREATE FUNCTION id2username(oid) RETURNS text > > LANGUAGE 'SQL' IMMUTABLE AS ' > > SELECT username AS RESULT FROM users WHERE uid = $1'; > > This is simply dangerous. The function is *NOT* immutabl