pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: cstotes@hotmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: create type input and output function examples
Date: Tue, 04 Nov 2003 11:18:55 MET
Message-ID: <200311041018.LAA19497@rodos> (raw)
In-Reply-To: <BAY9-F45nXagRgsPLni00070b92@hotmail.com>

> 
> 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 <typinput> resp. <typoutput> 

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 




view thread (2+ messages)

Message-ID: <200311041018.LAA19497@rodos>
Permalink:  ../200311041018.LAA19497@rodos/
Also on:    postgresql.org/message-id/200311041018.LAA19497@rodos

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ch@rodos.fzk.de, cstotes@hotmail.com
  Subject: Re: create type input and output function examples
  In-Reply-To: <200311041018.LAA19497@rodos>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox