I'm trying to understand how to insert a composite type value. I'm having trouble with the last sql statement below. It errors out with:
ERROR: cannot cast type record to atype How should I create a composite type value out of columns a and b in table tt that I can insert into table atable? CREATE TYPE atype AS ( acol TEXT, bcol TEXT ); CREATE TABLE atable ( aval atype ); CREATE TEMP TABLE tt AS SELECT 'aaa'::text AS a, 'bbb'::text AS b; INSERT INTO atable SELECT ROW(a, b) FROM tt; Thanks as always. -- Ron Peterson https://www.yellowbank.com/ ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly