Skip site navigation (1) Skip section navigation (2)

Re: system catalog relation of a table and a serial sequence

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brent Verner <brent(at)rcfile(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: system catalog relation of a table and a serial sequence
Date: 2001-12-16 04:25:50
Message-ID: 17678.1008476750@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Brent Verner <brent(at)rcfile(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Brent VernerDate: 2001-12-16 04:38:19
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence
Previous:From: Tom LaneDate: 2001-12-16 04:17:54
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence

pgsql-patches by date

Next:From: Brent VernerDate: 2001-12-16 04:38:19
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence
Previous:From: Tom LaneDate: 2001-12-16 04:17:54
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group