Re: inserting values into types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrew Thorley" <andrew(dot)thorley(at)linuxmail(dot)org>
Cc: "Michael Fuhr" <mike(at)fuhr(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: inserting values into types
Date: 2004-12-01 22:11:32
Message-ID: 19848.1101939092@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Andrew Thorley" <andrew(dot)thorley(at)linuxmail(dot)org> writes:
> CREATE TYPE qwerty_UDT AS (abc INT);
> CREATE TABLE t (col1 qwerty_UDT);
> INSERT INTO t (col1) VALUES (qwerty_UDT(123));
> ERROR: function qwerty_udt(integer) does not exist

Just say

INSERT INTO t (col1) VALUES (ROW(123));

Note this will not work at all on pre-8.0 Postgres.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2004-12-01 22:23:12 Re: Query is slower
Previous Message Andrew Thorley 2004-12-01 21:58:11 Re: inserting values into types