X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 41EE1D1BB21 for ; Fri, 22 Aug 2003 16:32:38 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 38558-06 for ; Fri, 22 Aug 2003 16:32:33 -0300 (ADT) Received: from web4.betterthanyours.com (unknown [63.220.222.33]) by svr1.postgresql.org (Postfix) with ESMTP id 24E69D1BA75 for ; Fri, 22 Aug 2003 16:32:26 -0300 (ADT) Received: from [65.82.122.144] (helo=fig) by web4.betterthanyours.com with asmtp (Exim 4.20) id 19qHdu-0004P5-5p for pgsql-sql@postgresql.org; Fri, 22 Aug 2003 15:32:14 -0400 Reply-To: From: To: "Pgsql-Sql" Subject: composite type in a table Date: Fri, 22 Aug 2003 14:32:27 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - web4.betterthanyours.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - 4peakstech.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=BAYES_30, MSGID_GOOD_EXCHANGE, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200308/278 X-Sequence-Number: 14894 is there any way to use a composite type in a table? here's an example: say i want to create a type to hold currency: create type currency_type as ( base_objid int, base_amt decimal, conversion_rate decimal, converted_objid int ); i'd like to be able to define a column in a table of type currency_type: create table currency_table ( myMoney currency_type ); unfortunately, i get: ERROR: Attribute "mymoney" has composite type currency_type it sure would be nice if it was as simple as this, but it isn't. what's the easiest way to create a composite-like type that can be added to a table? also, how does one access the internal fields of a composite type? Regards, Floyd Shackelford VOICE: 334.735.9428 FAX: 702.995.6462 EMAIL: floyd@fwshackelford.com ICQ #: 161371538 PGP Key ID: 0x2E84F2F2 PGP Fone at private.fwshackelford.com on request Shackelford Motto: ACTA NON VERBA - Actions, not words Alabama State Motto: AUDEMUS JURA NOSTRA DEFENDERE - We Dare Defend Our Rights The Philosophy of Liberty: http://www.isil.org/resources/introduction.swf "Just because you do not take an interest in politics doesn't mean politics won't take an interest in you." -- Pericles (430 B.C.) "I cannot undertake to lay my finger on that article of the Constitution which granted a right to Congress of expending, on objects of benevolence, the money of their constituents...." --James Madison