"Vilson farias" <vilson.farias@digitro.com.br> writes:
> persona=# explain select * from teste_erro where cod = teste_proc('3138414411','19');
> NOTICE: QUERY PLAN:
> Seq Scan on teste_erro (cost=0.00..25.00 rows=10 width=4)
> EXPLAIN
You need to mark the function cachable, else the planner doesn't
believe it's a constant. See "iscachable" in the CREATE FUNCTION
reference page.
regards, tom lane