Subject: using "text" type arguments in c functions in postgres

From: [email-masked]
Date: Tue, 29 Jun 93 13:29:56 -0700

I'm trying to write a C function that takes in a composite
type as its argument and returns a boolean.  One of the
attributes of my composite type is of type "text" and another
is of type "text[]".  What C data types should I use in my
code?  What C operators are available for these C data types?
How can I find this information out in general?

Do I have to use the varlena data type somehow?

Lin Chase
CMU

---

From: [email-masked] (Paul M. Aoki)
Date: Tue, 29 Jun 93 14:20:48 -0700

i assume you mean a user-defined function that will be included
into the backend.

[email-masked] writes:
> type as its argument and returns a boolean.

composite types are accessed as described in the user manual,
src/doc/manual.ps.

> One of the

text is really implemented as struct varlena.  the builtin
operations on struct varlena are in src/utils/adt/varlena.c.
the definition is in tmp/c.h.

in general, code that implements most operations on builtin types 
are in src/utils/adt.  headers are either in src/utils or tmp/c.h.
(some (but not all) of them are installed in include/ by postgres 4.1).
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki