Manfred Koizar <[EMAIL PROTECTED]> writes:
> here is an implementation of a set of user types: char3, char4,
> char10.

Coupla quick comments on these:

> CREATE FUNCTION charNN_lt(charNN, charNN)
>     RETURNS boolean
>     AS '$libdir/fixchar'
>     LANGUAGE 'c';

> bool
> charNN_lt(char *a, char *b)
> {
>       return (strncmp(a, b, NN) < 0);
> }/*charNN_lt*/

These functions are dangerous as written, because they will crash on
null inputs.  I'd suggest marking them strict in the function
declarations.  Some attention to volatility declarations (isCachable
or isImmutable) would be a good idea too.

Also, it'd be faster and more portable to write the functions with
version-1 calling conventions.

Using the Makefile to auto-create the differently sized versions is
a slick trick...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to