Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-08 Thread Bruce Momjian
Alexsander Rosa wrote: > At 8.4 release notes, item "E.5.3.3.1. TRUNCATE" there's a sentence: > "The start value of a sequence can be changed by ALTER SEQUENCE START WITH. > " > > Maybe this sentence should be copied/moved to "E.5.3.4.1. ALTER" with extra > text stating that START, in previous ver

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-08 Thread Alexsander Rosa
Well, if it's not going to be fixed, then at least the docs should be revised to warn all 8.4+ users to avoid this command and, if it's really needed, always check the server version before using the ALTER SEQUENCE ... START command, once it has a potentially hazardous bug that interprets it as a R

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-08 Thread Alexsander Rosa
At 8.4 release notes, item "E.5.3.3.1. TRUNCATE" there's a sentence: "The start value of a sequence can be changed by ALTER SEQUENCE START WITH. " Maybe this sentence should be copied/moved to "E.5.3.4.1. ALTER" with extra text stating that START, in previous versions, was an (unintended) alias to

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-08 Thread Bruce Momjian
Alexsander Rosa wrote: > Well, if it's not going to be fixed, then at least the docs should be > revised to warn all 8.4+ users to avoid this command and, if it's really > needed, always check the server version before using the ALTER SEQUENCE ... > START command, once it has a potentially hazardou

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-07 Thread Bruce Momjian
Alexsander Rosa wrote: > What about the risk of using ALTER SEQUENCE ... START N in a mixed > environment? In the 8.4.x servers it will work as designed but in the 8.3.x > (and below) servers, instead of issuing an error it will CORRUPT the > sequence value without notice. I understand the point of

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-02 Thread Alexsander Rosa
What about the risk of using ALTER SEQUENCE ... START N in a mixed environment? In the 8.4.x servers it will work as designed but in the 8.3.x (and below) servers, instead of issuing an error it will CORRUPT the sequence value without notice. I understand the point of keeping a (mis)feature when it

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-01 Thread Alvaro Herrera
Excerpts from Euler Taveira de Oliveira's message of miƩ sep 01 10:18:10 -0400 2010: > Tom Lane escreveu: > > I'm not inclined to go and retroactively document that these spellings > > are possible but deprecated in the old branches. I think that would > > just confuse matters even more. > > Is

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-09-01 Thread Euler Taveira de Oliveira
Tom Lane escreveu: > I'm not inclined to go and retroactively document that these spellings > are possible but deprecated in the old branches. I think that would > just confuse matters even more. > Is it worth preventing that sloppy implementation in the old branches? -- Euler Taveira de Oli

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-27 Thread Tom Lane
Alexsander Rosa writes: > Let me get this straight: in version 8.3 the ALTER SEQUENCE command has an > *undocumented* [1] clause START that is actually an alias for RESTART (i.e. > both reset the sequence value to the value passed by the mandatory > argument). Yeah. I just looked at the old code

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-27 Thread Alexsander Rosa
-- Forwarded message -- From: Alexsander Rosa Date: 2010/8/27 Subject: Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART To: Tom Lane Let me get this straight: in version 8.3 the ALTER SEQUENCE command has an *undocumented* [1] clause START that is actually an

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-26 Thread Marko Tiikkaja
On 2010-08-27 12:51 AM +0300, Tom Lane wrote: Alexsander Rosa writes: According the docs, 8.3 does NOT have a START clause -- only RESTART. I think a START clause should raise an error at 8.3 servers; there's a chance of someone run the command in several servers (like a pgdiff) and get differe

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-26 Thread Tom Lane
Alexsander Rosa writes: > According the docs, 8.3 does NOT have a START clause -- only RESTART. I > think a START clause should raise an error at 8.3 servers; there's a chance > of someone run the command in several servers (like a pgdiff) and get > different behaviour for the same command. We're

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-26 Thread Alexsander Rosa
Then the docs are misleading: http://www.postgresql.org/docs/8.3/static/sql-altersequence.html According the docs, 8.3 does NOT have a START clause -- only RESTART. I think a START clause should raise an error at 8.3 servers; there's a chance of someone run the command in several servers (like a p

Re: [BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-26 Thread Tom Lane
"Alexsander" writes: > CREATE SEQUENCE foo; > SELECT setval('foo',12345); > ALTER SEQUENCE foo START WITH 10; -- can't change value > SELECT nextval('foo'); -- it's 10 instead of 12346 > Apparently START is executing a RESTART. Yup. That's what it's defined to do, pre-8.4.

[BUGS] BUG #5629: ALTER SEQUENCE foo START execute a RESTART

2010-08-26 Thread Alexsander
The following bug has been logged online: Bug reference: 5629 Logged by: Alexsander Email address: alexsander.r...@gmail.com PostgreSQL version: 8.3.11 Operating system: Linux Description:ALTER SEQUENCE foo START execute a RESTART Details: Steps to reproduce: CREAT