Re: Returning setof records

Поиск
Список
Период
Сортировка
От Scott Schulthess
Тема Re: Returning setof records
Дата
Msg-id 4BF377919225F449BB097CB76FFE9BC83DD7F0@ptolemy.topozone.com
обсуждение исходный текст
Ответ на Returning setof records  ("Scott Schulthess" <scott@topozone.com>)
Ответы Re: Returning setof records
Список pgsql-admin
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@sss.pgh.pa.us]
Sent: Friday, January 20, 2006 11:39 AM
To: Scott Schulthess
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Returning setof records

"Scott Schulthess" <scott@topozone.com> 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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Returning setof records
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Returning setof records