INSERT with a composite columnt from query

Поиск
Список
Период
Сортировка
От Reg Me Please
Тема INSERT with a composite columnt from query
Дата
Msg-id 200801161139.55072.regmeplease@gmail.com
обсуждение исходный текст
Ответы Re: INSERT with a composite columnt from query  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Re: INSERT with a composite columnt from query  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hi all.

I have two table like these:

create table compo (
  t text,
  i int
);

create table tab (
  x int,
  c compo
);

Then I have a function like this:

create or replace function f_compo()
returns setof compo as $body$
...
$body$ language sql stable;


What I'd need to do is to insert the results from f_compo() into
the table TAB along with a value x.

I expected somthing like this to work:

insert into tab
  select 42,row( c.* ) from f_compo() c;

But I get
ERROR:  cannot cast type record to compo

Any hint?

TALIA

--
Reg me, please!

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

Предыдущее
От: Clodoaldo
Дата:
Сообщение: Re: ATTN: Clodaldo was Performance problem. Could it be related to 8.3-beta4?
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: INSERT with a composite columnt from query