Hi,
In a plpgsl function, consider the following excerpt:
DECLARE provider_id INTEGER;
BEGIN provider_id := (SELECT provider_id FROM investment_products WHERE id =
my_new.investment_product_id);
END;
After a lot of trouble, I found out this line doesn't work correctly
with the variable name as it is. It doesn't give an error or anything,
it just retrieves some wrong value (probably NULL). When I change the
variable name to anything other than "provider_id", it works OK.
I was somewhat surprised to discover this. Can't Postgres determine that
the provider_id in the SELECT statement is not the same one as the variable?