Tom - I've also tried this select * from placenamesearch('Cheshire',9,'New Haven','','') as (FeatureName varchar, CountyName varchar, State char, Cellname varchar, Elevation int4, PrimaryLatDD float8, PrimaryLonDD float8); ERROR: wrong record type supplied in RETURN NEXT :( 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. -Scott -----Original Message----- From: Tom Lane [mailto:tgl@xxxxxxxxxxxxx] Sent: Friday, January 20, 2006 11:39 AM To: Scott Schulthess Cc: pgsql-admin@xxxxxxxxxxxxxx Subject: Re: [ADMIN] Returning setof records "Scott Schulthess" <scott@xxxxxxxxxxxx> writes: > select * from placenamesearch('Cheshire',9,'New Haven','text', 'text') > as (FeatureName varchar, CountyName varchar, State varchar, featuretype > varchar, Elevation int4,CellName varchar, PrimaryLatDD float8, > PrimaryLonDD float8); ... > state char(2), You've got the State output column declared as varchar, but actually it's char. PG will often do automatic conversion from one type to the other, but in this context it's picky... regards, tom lane