Couldn't cast to record[]

Поиск
Список
Период
Сортировка
От Suresh Kumar R
Тема Couldn't cast to record[]
Дата
Msg-id CAH+y2+ZJcGmtO_qtyROHzoZYWKXn1tvVPKtQNDi1kxrwusM-Tg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Couldn't cast to record[]  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Couldn't cast to record[]  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Couldn't cast to record[]  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Hi, I created an table with composite type array as datatype for one column.
When I query that table I need the pg_typeof(column) as record[] instead of
composite_type[].
I tried creating a separate function and returning record[], but below error
is thrown,

ERROR:  PL/pgSQL functions cannot return type record[]

Below is sample for my requirement.

pali=# create type address as (number bigint, city varchar);
CREATE TYPE
pali=# create table person(name varchar, addresses address[]);
CREATE TABLE
pali=# insert into person values ('Michael', array[(82, 'NYC'),(24,
'Dunkirk')]::address[]);
INSERT 0 1
pali=# select pg_typeof(addresses::record[]) from person ;
 pg_typeof
-----------
 address[]

Here I expect record[] instead of address[].

Thanks in advance.

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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Postgres Wal Full
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Couldn't cast to record[]