Re: Problem with function - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with function
Date
Msg-id 10444.1075600422@sss.pgh.pa.us
Whole thread Raw
In response to Problem with function  ("Frank Millman" <frank@chagford.com>)
Responses Re: Problem with function  (Rich Hall <rhall@micropat.com>)
List pgsql-general
"Frank Millman" <frank@chagford.com> writes:
>       uom := (select uom from prodclass where code = prod_class) ;
        ^^^            ^^^

It's a bad idea to use plpgsql variable names that match fields of your
tables.  In this case, since the variable uom starts out NULL, the
select effectively reads "(select NULL from ...)".

            regards, tom lane

pgsql-general by date:

Previous
From: Culley Harrelson
Date:
Subject: Re: Unicode vs SQL_ASCII DBs
Next
From: Eric Ridge
Date:
Subject: Re: Very slow query - why?