Re: [HACKERS] wrong optimization ( postgres 8.0.3 )

2005-10-05 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: > Gaetano Mendola <[EMAIL PROTECTED]> writes: >> What I'm experiencing is a problem ( I upgraded today from >> 7.4.x to 8.0.3 ) that I explain here: > >> The following function just return how many records there >> are inside the view

Re: [HACKERS] wrong optimization ( postgres 8.0.3 )

2005-10-05 Thread Tom Lane
Gaetano Mendola <[EMAIL PROTECTED]> writes: > What I'm experiencing is a problem ( I upgraded today from > 7.4.x to 8.0.3 ) that I explain here: > The following function just return how many records there > are inside the view v_current_connection > CREATE OR REPLACE FUNCTION sp_count ( ) > RETUR

[HACKERS] wrong optimization ( postgres 8.0.3 )

2005-10-05 Thread Gaetano Mendola
Hi all, take a look at this simple function and view: CREATE OR REPLACE FUNCTION sp_connected_test ( INTEGER ) RETURNS BOOLEAN AS' DECLARE a_id_user ALIAS FOR $1; BEGIN PERFORM * FROM v_current_connection WHERE id_user = a_id_user; IF NOT FOUND THEN RETURN FALSE; END IF;