pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
create type input and output function examples
2+ messages / 2 participants
[nested] [flat]

* create type input and output function examples
@ 2003-10-29 04:06  Clint Stotesbery <cstotes@hotmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Clint Stotesbery @ 2003-10-29 04:06 UTC (permalink / raw)
  To: pgsql-sql

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.

_________________________________________________________________
Surf and talk on the phone at the same time with broadband Internet access. 
Get high-speed for as low as $29.95/month (depending on the local service 
providers in your area).  https://broadband.msn.com




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: create type input and output function examples
@ 2003-11-04 11:18  Christoph Haller <ch@rodos.fzk.de>
  parent: Clint Stotesbery <cstotes@hotmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Christoph Haller @ 2003-11-04 11:18 UTC (permalink / raw)
  To: cstotes@hotmail.com; +Cc: pgsql-sql

> 
> 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 




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-11-04 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-29 04:06 create type input and output function examples Clint Stotesbery <cstotes@hotmail.com>
2003-11-04 11:18 ` Christoph Haller <ch@rodos.fzk.de>

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