X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 409E1D1CA81 for ; Tue, 4 Nov 2003 10:19:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 64259-05 for ; Tue, 4 Nov 2003 06:19:19 -0400 (AST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id C5FF0D1CA7A for ; Tue, 4 Nov 2003 06:19:15 -0400 (AST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Tue Nov 04 11:18:57 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id LAA08089; Tue, 4 Nov 2003 11:18:56 +0100 (MET) From: Christoph Haller Message-Id: <200311041018.LAA19497@rodos> Subject: Re: create type input and output function examples To: cstotes@hotmail.com (Clint Stotesbery) Date: Tue, 04 Nov 2003 11:18:55 MET Cc: pgsql-sql@postgresql.org In-Reply-To: ; from "Clint Stotesbery" at Oct 29, 103 5:09 am X-Mailer: Elm [revision: 212.4] X-Virus-Scanned: by amavisd-new at postgresql.org X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char 9C hex) in message header 'Received' Received: \234by rodos.fzk.de... ^ X-Archive-Number: 200311/13 X-Sequence-Number: 15828 > > I've seen the docs for create type and an example of the syntax to create a > type. What I haven't seen is the functions that are passed for the input and > output elements. > > CREATE TYPE box (INTERNALLENGTH = 8, > INPUT = my_procedure_1, OUTPUT = my_procedure_2); > > Now what would be in my_procedure1 and my_procedure2 procedures? I know they > are just example placeholders above but I need to see a real example of what > would be in those procedures to better understand what they should do. > Thanks. > Pretty late reply, hopefully not too late. My understanding is these procedures are C functions. For examples do the following: List the types already in use and their io-functions as select typname, typinput, typoutput from pg_type ; Then search the source code (*.c files) for resp. There is a box type already. It's box_in and box_out functions can be found in $PGSQLD/src/backend/utils/adt/geo_ops.c HTH Regards, Christoph