Re: Problem with function

From: Rich Hall <rhall(at)micropat(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with function
Date: 2004-02-02 14:20:52
Message-ID: 401E5CC4.7080605@micropat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>
uom := (select uom from prodclass where code = prod_class) ;
>>

Now I want to know why this syntax even compiles!?
What does this mean in plpgsql and where can I find a discussionin the
documentation?

Rick

Tom Lane wrote:

>"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
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>
>
>

--

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2004-02-02 14:36:00 Return Value of a Function
Previous Message Remi 2004-02-02 14:03:46 Postgresql 7.3 And Redhat Enterprise 3