Re: system catalog relation of a table and a serial sequence - Mailing list pgsql-hackers

From Tom Lane
Subject Re: system catalog relation of a table and a serial sequence
Date
Msg-id 17678.1008476750@sss.pgh.pa.us
Whole thread Raw
In response to Re: system catalog relation of a table and a serial sequence  (Brent Verner <brent@rcfile.org>)
Responses Re: system catalog relation of a table and a serial sequence
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Brent Verner
Date:
Subject: Re: [PATCHES] system catalog relation of a table and a serial sequence
Next
From: Brent Verner
Date:
Subject: Re: [PATCHES] system catalog relation of a table and a serial sequence