Re: BUG #7784: trouble with pl ERROR: missing FROM-clause entry for table

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7784: trouble with pl ERROR: missing FROM-clause entry for table
Date: 2013-01-04 01:30:21
Message-ID: 1357263021085-5738698.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

smatiz wrote
> The following bug has been logged on the website:
>
> Bug reference: 7784
> Logged by: Santiago Matiz Vasquez
> Email address:

> smatiz@

> PostgreSQL version: 9.2.2
> Operating system: MAC LION 10.7.4
> Description:
>
>
> CREATE OR REPLACE FUNCTION financiero.marchar(pidproducto int,pcant
> int,pnrocuenta int,pcedula character varying(20)) RETURNS character
> varying(100) AS $$
>
> result:
> ERROR: missing FROM-clause entry for table "valores"
> LINE 1: SELECT valores.iva
> ^
> QUERY: SELECT valores.iva
> CONTEXT: PL/pgSQL function
> financiero.marchar(integer,integer,integer,character varying) line 31 at
> RAISE

From what I can infer from my reading the function you shown here should
work.

As the example is not self-contained it is difficult to prove whether it is
indeed correct or not. The error indicates that the statement "SELECT
valores.iva" was attempted somewhere but that exact construct is not present
in the function shown. I am also not sure exactly where line "31" is in the
supplied code.

I suggest two steps to move along further:

First, make sure that you are executing the function that you think you are.
Search path issues may have cropped up somewhere and a previous, invalid,
version may still be sitting around somewhere.

Next (if necessary), try to narrow down, keep, and point out only the
offending code and whatever is minimally necessary to make it execute.

Unless the example provided is self-contained simply putting out the entire
code without any commentary makes it more difficult for people to provide
help.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-7784-trouble-with-pl-ERROR-missing-FROM-clause-entry-for-table-tp5738676p5738698.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-01-04 06:54:53 Re: BUG #7784: trouble with pl ERROR: missing FROM-clause entry for table
Previous Message Tom Lane 2013-01-03 22:29:28 Re: BUG #7783: lower & upper function incorrect work