Re: CREATE SEQUENCE with RESTART option

2021-07-28 Thread Michael Paquier
On Wed, Jul 28, 2021 at 01:16:19PM -0400, Tom Lane wrote: > I do not see any RESTART option in SQL:2021 11.72 definition>. Since we don't document it either, there's really no > expectation that anyone would use it. Okay, good point. I was not aware of that. > I don't particularly think that

Re: CREATE SEQUENCE with RESTART option

2021-07-28 Thread Tom Lane
Fujii Masao writes: > On 2021/07/28 23:53, Bharath Rupireddy wrote: >> -1. IMHO, this is something creating more confusion to the user. We >> say that we allow both START and RESTART that RESTART is accepted as a >> consequence of our internal option handling in gram.y. Instead, I >> recommend

Re: CREATE SEQUENCE with RESTART option

2021-07-28 Thread Fujii Masao
On 2021/07/28 23:53, Bharath Rupireddy wrote: On Wed, Jul 28, 2021 at 11:50 AM Michael Paquier wrote: On Mon, Jul 26, 2021 at 04:57:53PM +0900, Michael Paquier wrote: FWIW, like Ashutosh upthread, my vote would be to do nothing here in terms of behavior changes as this is just breaking a

Re: CREATE SEQUENCE with RESTART option

2021-07-28 Thread Bharath Rupireddy
On Wed, Jul 28, 2021 at 11:50 AM Michael Paquier wrote: > > On Mon, Jul 26, 2021 at 04:57:53PM +0900, Michael Paquier wrote: > > FWIW, like Ashutosh upthread, my vote would be to do nothing here in > > terms of behavior changes as this is just breaking a behavior for the > > sake of breaking it,

Re: CREATE SEQUENCE with RESTART option

2021-07-28 Thread Michael Paquier
On Mon, Jul 26, 2021 at 04:57:53PM +0900, Michael Paquier wrote: > FWIW, like Ashutosh upthread, my vote would be to do nothing here in > terms of behavior changes as this is just breaking a behavior for the > sake of breaking it, so there are chances that this is going to piss > some users that

Re: CREATE SEQUENCE with RESTART option

2021-07-26 Thread Michael Paquier
On Sat, Jul 24, 2021 at 09:56:40PM +0530, Bharath Rupireddy wrote: > LGTM. PSA v2 patch. FWIW, like Ashutosh upthread, my vote would be to do nothing here in terms of behavior changes as this is just breaking a behavior for the sake of breaking it, so there are chances that this is going to piss

Re: CREATE SEQUENCE with RESTART option

2021-07-24 Thread Bharath Rupireddy
e. Allowing both START and > * RESTART option for CREATE SEQUENCE may cause confusion to user. > * Hence, we throw error for CREATE SEQUENCE if RESTART option is > * specified. However, it can be used with ALTER SEQUENCE. > */ > > I would remove the first sentence, because it

Re: CREATE SEQUENCE with RESTART option

2021-07-23 Thread Cary Huang
in my environment. Regarding your comments in the patch: /* * Restarting a sequence while defining it doesn't make any sense * and it may override the START value. Allowing both START and * RESTART option for CREATE SEQUENCE may cause confusion to user. * Hence, we throw error for CREATE SEQUENCE

Re: CREATE SEQUENCE with RESTART option

2021-04-08 Thread Bharath Rupireddy
On Thu, Apr 8, 2021 at 3:16 PM Suraj Kharage wrote: >> > The RESTART clause in the CREATE SEQUENCE doesn't make sense >> > to me, it should be restricted, IMO. > > +1 > >> >> Thanks! Attaching a patch that throws an error if the RESTART option >> is specified with CREATE SEQUENCE. Please have a

Re: CREATE SEQUENCE with RESTART option

2021-04-08 Thread Suraj Kharage
On Thu, Apr 8, 2021 at 2:03 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > > > > > The RESTART clause in the CREATE SEQUENCE doesn't make sense > > to me, it should be restricted, IMO. > +1 > > Thanks! Attaching a patch that throws an error if the RESTART option > is

Re: CREATE SEQUENCE with RESTART option

2021-04-08 Thread Bharath Rupireddy
ecause it may override the START option." in err_detail along with the error message? With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com From 819d653cc2be54e822826f08905f6ce8ec2f8418 Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Thu, 8 Apr 2021 13:35:38 +05

Re: CREATE SEQUENCE with RESTART option

2021-04-07 Thread Amul Sul
On Wed, Apr 7, 2021 at 6:52 PM Bharath Rupireddy wrote: > > On Wed, Apr 7, 2021 at 6:04 PM Ashutosh Bapat > wrote: > > At best CREATE SEQUENCE START ... RESTART ... can be a shorthand > > for CREATE SEQUENCE ... START; ALTER SEQUENCE ... RESTART run back to > > back. So it looks useful but

Re: CREATE SEQUENCE with RESTART option

2021-04-07 Thread Bharath Rupireddy
On Wed, Apr 7, 2021 at 6:04 PM Ashutosh Bapat wrote: > At best CREATE SEQUENCE START ... RESTART ... can be a shorthand > for CREATE SEQUENCE ... START; ALTER SEQUENCE ... RESTART run back to > back. So it looks useful but in rare cases. I personally feel that let's not mix up START and

Re: CREATE SEQUENCE with RESTART option

2021-04-07 Thread Ashutosh Bapat
tively, do we need to throw an error if the user is not > supposed to use the "restart" option with CREATE SEQUENCE? > > IMO, allowing the "restart" option for CREATE SEQUENCE doesn't make > sense when we have the "start" option, so it's better to throw an >

CREATE SEQUENCE with RESTART option

2021-04-07 Thread Bharath Rupireddy
on behaviour for ALTER SEQUENCE, we have no mention of it in the CREATE SEQUENCE docs page. Do we need to document the above behaviour for CREATE SEQUENCE? Alternatively, do we need to throw an error if the user is not supposed to use the "restart" option with CREATE SEQUENCE? IMO, allowing