Bug 176497
Summary: | PostgreSQL plpgsql function bug | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomi Malkki <tomi> |
Component: | postgresql | Assignee: | Tom Lane <tgl> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4 | CC: | hhorak |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-12-23 21:48:51 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Tomi Malkki
2005-12-23 18:36:03 UTC
Sorry, this is just pilot error. You used auid as a parameter alias, so the SELECT command effectively has WHERE $1=$1, which means admin_rec always gets the first row of admins2. It's a good rule of thumb never to use any variable or parameter names in a function that are identical to names of fields or tables you need to access in that function; otherwise both you and the machine are likely to get confused. BTW, I don't think IS NOT NULL on a RECORD variable will do what you expect, either. You probably want to write IF FOUND THEN there. |