Skip site navigation (1) Skip section navigation (2)

Re: advice on extensions needed

From: Brook Milligan <brook(at)biology(dot)nmsu(dot)edu>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: advice on extensions needed
Date: 2000-08-25 18:19:30
Message-ID: 200008251819.MAA25810@biology.nmsu.edu (view raw or flat)
Thread:
Lists: pgsql-hackers
   > - Is it possible to write functions to automatically convert one
   >   extended type into another?  If so, how should this be done?

   A function named the same as a type, with one argument of some other
   type, is treated as an implicit type conversion rule by 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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-08-25 18:25:37
Subject: Re: Performance on inserts
Previous:From: John McKownDate: 2000-08-25 17:56:24
Subject: Access PostgreSQL server via SSL/Internet

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group