Re: advice on extensions needed - Mailing list pgsql-hackers

From Brook Milligan
Subject Re: advice on extensions needed
Date
Msg-id 200008251819.MAA25810@biology.nmsu.edu
Whole thread Raw
In response to Re: advice on extensions needed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> - Is it possible to write functions to automatically convert one  >   extended type into another?  If so, how
shouldthis be done?
 
  A function named the same as a type, with one argument of some other  type, is treated as an implicit type conversion
ruleby the parser.
 

Just to make sure I understand.  Suppose I create two user-defined
types A and B and want interconversions.  I will need the following
functions, right?
/* I/O */
A * A_in (const char *);
char * A_out (const A *);
B * B_in (const char *);
char * B_out (const B *);
/* conversions */
A * A (const B *);
B * B (const A *);

Thanks again.

Cheers,
Brook


pgsql-hackers by date:

Previous
From: John McKown
Date:
Subject: Access PostgreSQL server via SSL/Internet
Next
From: Tom Lane
Date:
Subject: Re: Performance on inserts