Re: select fails inside function, but works otherwise - Mailing list pgsql-general

From Daniel Wickstrom
Subject Re: select fails inside function, but works otherwise
Date
Msg-id 15030.26360.260316.532372@gargle.gargle.HOWL
Whole thread Raw
In response to Re: select fails inside function, but works otherwise  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

    Tom> Daniel Wickstrom <danw@rtp.ericsson.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;

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

That was the problem.


Thanks,

Dan

pgsql-general by date:

Previous
From: Jan Ploski
Date:
Subject: Re: concurrent updates problem
Next
From: Rick Delaney
Date:
Subject: Accessing serials through rules