Re: inserting values into types - Mailing list pgsql-sql

From Tom Lane
Subject Re: inserting values into types
Date
Msg-id 19848.1101939092@sss.pgh.pa.us
Whole thread Raw
In response to Re: inserting values into types  ("Andrew Thorley" <andrew.thorley@linuxmail.org>)
List pgsql-sql
"Andrew Thorley" <andrew.thorley@linuxmail.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


pgsql-sql by date:

Previous
From: "Andrew Thorley"
Date:
Subject: Re: inserting values into types
Next
From: Stephan Szabo
Date:
Subject: Re: Query is slower