Re: Returning setof records - Mailing list pgsql-admin

From Tom Lane
Subject Re: Returning setof records
Date
Msg-id 25010.1137776827@sss.pgh.pa.us
Whole thread Raw
In response to Re: Returning setof records  ("Scott Schulthess" <scott@topozone.com>)
List pgsql-admin
"Scott Schulthess" <scott@topozone.com> writes:
> :( I realize it often automatically converts, and I've tried using
> varchar and char for the state column, as well as int4, integer, and int
> for the other columns.

[ looks again... ]  Oh, wait, you're getting caught by a standard
plpgsql gotcha:

> create function placenamesearch(place text, state integer, county text,
                                              ^^^^^
> FOR myview IN SELECT featurename, countyname, state, featuretype,
                                                ^^^^^

plpgsql variable names win out over table column names, so what's coming
back in the SELECT result's third column is the integer "state"
parameter.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Scott Schulthess"
Date:
Subject: Re: Returning setof records
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [Slony1-general] "Blueprints for High Availability"