Brent Verner <brent@rcfile.org> writes:
> Why not use strtok?
Well, it's ugly (I don't like non-reentrant library routines), it's
not really buying anything, and I don't think you've got the corner
cases right anyway. I'd go for something like
if (strlen(adsrc) > 19 &&
strncmp(adsrc, "nextval('\"", 10) == 0 &&
strcmp(adsrc + strlen(adsrc) - 9, "\"'::text)") == 0)
regards, tom lane