Re: Problem with function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Frank Millman" <frank(at)chagford(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with function
Date: 2004-02-01 01:53:42
Message-ID: 10444.1075600422@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Frank Millman" <frank(at)chagford(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Ridge 2004-02-01 01:56:14 Re: Very slow query - why?
Previous Message Culley Harrelson 2004-02-01 00:51:03 Re: Unicode vs SQL_ASCII DBs