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 D18EF3A5E61 for ; Mon, 6 Dec 2004 04:03:36 +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 69774-02 for ; Mon, 6 Dec 2004 04:03:32 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id EAAB53A2307 for ; Mon, 6 Dec 2004 04:03:31 +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 iB643QM0028401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 5 Dec 2004 21:03:28 -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 iB643Pap048381; Sun, 5 Dec 2004 21:03:25 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iB643P41048380; Sun, 5 Dec 2004 21:03:25 -0700 (MST) (envelope-from mfuhr) Date: Sun, 5 Dec 2004 21:03:24 -0700 From: Michael Fuhr To: Yasir Malik Cc: PostgreSQL Subject: Re: inserting values into types Message-ID: <20041206040324.GA48287@winnie.fuhr.org> References: <20041201215811.476CF23CE8@ws5-3.us4.outblaze.com> <20041201234311.L622@hermes.hilbert.loc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/37 X-Sequence-Number: 19657 On Sat, Dec 04, 2004 at 11:13:29PM -0500, Yasir Malik wrote: > >>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 > >>HINT: No function matches the given name and argument types. You may > >>need to add explicit type casts. > > It seems as though you want to create your own user-defined types. That > isn't easy in PostgreSQL. That the CREATE TABLE statement succeeded implies that he's using PostgreSQL 8.0, which has better support for composite types than previous versions. What he's trying to do will work -- he just has the syntax wrong. http://developer.postgresql.org/docs/postgres/rowtypes.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/