Re: [GENERAL] composite type insert

2006-11-19 Thread Ron Peterson
On Sun, Nov 19, 2006 at 02:09:11AM -0500, Tom Lane wrote: > Ron Peterson <[EMAIL PROTECTED]> 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

Re: [GENERAL] composite type insert

2006-11-18 Thread Tom Lane
Ron Peterson <[EMAIL PROTECTED]> 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

[GENERAL] composite type insert

2006-11-18 Thread Ron Peterson
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? C