Re: composite type insert - Mailing list pgsql-general

From Tom Lane
Subject Re: composite type insert
Date
Msg-id 6146.1163920151@sss.pgh.pa.us
Whole thread Raw
In response to composite type insert  (Ron Peterson <ron.peterson@yellowbank.com>)
Responses Re: composite type insert  (Ron Peterson <ron.peterson@yellowbank.com>)
List pgsql-general
Ron Peterson <ron.peterson@yellowbank.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

pgsql-general by date:

Previous
From: "Thomas H."
Date:
Subject: tsearch trigger: function public.tsearch2(tsvector, text) does not exist
Next
From: Mark Lubratt
Date:
Subject: Running a query as a specific, different user