Re: Returning setof records

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Scott Schulthess" <scott(at)topozone(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Returning setof records
Date: 2006-01-20 17:07:07
Message-ID: 25010.1137776827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Scott Schulthess" <scott(at)topozone(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-20 17:39:50 Re: [Slony1-general] "Blueprints for High Availability"
Previous Message Scott Schulthess 2006-01-20 16:43:24 Re: Returning setof records