Re: composite type insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: composite type insert
Date: 2006-11-19 07:09:11
Message-ID: 6146.1163920151@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com> writes:
> How should I create a composite type value out of columns a and b in
> table tt that I can insert into table atable?

Hm, it works for me with an explicit cast:

INSERT INTO
atable
SELECT
ROW(a, b)::atype
FROM
tt;

Perhaps we should allow this in an automatic or even implicit cast
context.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Lubratt 2006-11-19 16:10:15 Running a query as a specific, different user
Previous Message Thomas H. 2006-11-19 03:59:22 tsearch trigger: function public.tsearch2(tsvector, text) does not exist