Re: select fails inside function, but works otherwise

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Wickstrom <danw(at)rtp(dot)ericsson(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select fails inside function, but works otherwise
Date: 2001-03-19 19:52:24
Message-ID: 20965.985031544@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Wickstrom <danw(at)rtp(dot)ericsson(dot)se> writes:
> -- This select is failing. It does not return the correct value
> -- when object_id = 44

> select context_id, security_inherit_p
> into context_id, security_inherit_p
> from acs_objects
> where object_id = check_path__object_id;

Try distinguishing the field names from the plpgsql variable names.
I believe the machine is seeing this as a command to select the current
values of the plpgsql variables (ie, two NULLs) into those same
variables. IIRC, unqualified names will be matched first to plpgsql
variables and only second to fields of the query tables.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2001-03-19 19:56:31 Re: Cant connect if -B 1024 was set to postmaster
Previous Message Vilson farias 2001-03-19 19:51:01 vacuumdb locked.