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

From Brent Verner
Subject Re: [PATCHES] system catalog relation of a table and a serial sequence
Date
Msg-id 20011216040332.GB7161@rcfile.org
Whole thread Raw
In response to system catalog relation of a table and a serial sequence  (Brent Verner <brent@rcfile.org>)
Responses Re: [PATCHES] system catalog relation of a table and a serial sequence
List pgsql-hackers
[2001-12-15 22:26] Rod Taylor said:
|
| > Brent Verner <brent@rcfile.org> writes:
| > > 1) Is a strcmp(firststrtok,"nextval('") == 0  sufficient to
| determine
| > >    that the adsrc is indeed one that we're looking for?  If not,
| > >    suggestions are greatly appreciated :-)
| >
| > I would not use strtok at all, but look for nextval('" at the start
| > of the string and "'::text) at the end.  If both match, and there's
| > at least one character between, then the intervening text can be
| > presumed to be a sequence name.  You might further check that the
| > apparent sequence name ends with _seq --- if not, it wasn't
| generated
| > by SERIAL.
|
| Wouldn't you want to include user sequences that are required for
| using the table?  If someone has used their own sequence as the
| default value for a column it would be nice to have it dumped as well.

This is my thought as well.  Hopefully Tom will concur.

cheers.
  brent

--
"Develop your talent, man, and leave the world something. Records are
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman

pgsql-hackers by date:

Previous
From: Brent Verner
Date:
Subject: Re: system catalog relation of a table and a serial sequence
Next
From: Tom Lane
Date:
Subject: Re: system catalog relation of a table and a serial sequence