"Robert Wimmer" <seppwimmer@hotmail.com> writes:
> text *t = PG_GETARG_TEXT_P(0);
> l = VARSIZE(t) - VARHDRSZ;
> for (i = 0; i < l; i++) { if ( (t->vl_dat[i] < '0') || (t->vl_dat[i] >
> '9')) break; }
> if (i==l) ret = 0;
> else ret = i;
I think you need to rethink your return convention --- success and
failure at the first character both return 0.
Directly using the vl_dat field doesn't seem like good style (you won't
find it anywhere in the backend sources) but it works.
regards, tom lane