X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7911F3A3C91 for ; Wed, 1 Dec 2004 00:18:44 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86930-06 for ; Wed, 1 Dec 2004 00:18:37 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id BF9AA3A51D6 for ; Wed, 1 Dec 2004 00:18:38 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id iB10HCKQ021196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Nov 2004 17:17:15 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id iB10HCC7090235; Tue, 30 Nov 2004 17:17:12 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iB10HClp090234; Tue, 30 Nov 2004 17:17:12 -0700 (MST) (envelope-from mfuhr) Date: Tue, 30 Nov 2004 17:17:12 -0700 From: Michael Fuhr To: Andrew Thorley Cc: pgsql-sql@postgresql.org Subject: Re: inserting values into types Message-ID: <20041201001711.GA87131@winnie.fuhr.org> References: <20041130235117.E60912B2B86@ws5-7.us4.outblaze.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041130235117.E60912B2B86@ws5-7.us4.outblaze.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/1 X-Sequence-Number: 19621 On Wed, Dec 01, 2004 at 07:51:17AM +0800, Andrew Thorley wrote: > ive generated a user defined type: CREATE TYPE qwerty_UDT AS (abc INT); > > & table as: CREATE TABLE t (col1 qwerty_UDT); Are you using 8.0? I don't think earlier versions allowed this. > my prob is that when i try to insert into the type i.e: INSERT INTO t (col1) Values (qwerty_UDT(123)); > > i get the error: > > ERROR: function test_x(integer) does not exist This error doesn't agree with the INSERT statement you gave -- it should say "function qwerty_udt(integer) does not exist". Where does test_x() come from? Did you type the SQL statements and/or error messages instead of cutting and pasting? We can see what's happening, but it's better to paste the exact statements and output to avoid mistakes. > HINT: No function matches the given name and argument types. You may need to add explicit type casts. See the "Composite Types" documentation -- it has a section entitled "Composite Value Input": http://developer.postgresql.org/docs/postgres/rowtypes.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/