Re: [HACKERS] system catalog relation of a table and a serial sequence

From: Brent Verner <brent(at)rcfile(dot)org>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence
Date: 2001-12-16 04:03:32
Message-ID: 20011216040332.GB7161@rcfile.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

[2001-12-15 22:26] Rod Taylor said:
|
| > Brent Verner <brent(at)rcfile(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-12-16 04:17:54 Re: [HACKERS] system catalog relation of a table and a serial sequence
Previous Message Brent Verner 2001-12-16 04:00:06 Re: system catalog relation of a table and a serial sequence

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-12-16 04:17:54 Re: [HACKERS] system catalog relation of a table and a serial sequence
Previous Message Brent Verner 2001-12-16 04:00:06 Re: system catalog relation of a table and a serial sequence