Re: CREATE SEQUENCE with RESTART option

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Suraj Kharage <suraj(dot)kharage(at)enterprisedb(dot)com>
Cc: Amul Sul <sulamul(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CREATE SEQUENCE with RESTART option
Date: 2021-04-08 10:34:09
Message-ID: CALj2ACWgj1+z0D4ko+60fG4VGgzyC3F47OmHM4q0amZ+TXMfBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 8, 2021 at 3:16 PM Suraj Kharage
<suraj(dot)kharage(at)enterprisedb(dot)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 specified with CREATE SEQUENCE. Please have a look and let me know
>> if the error message wording is fine or not. Is it better to include
>> the reason as to why we disallow something like "Because it may
>> override the START option." in err_detail along with the error
>> message?
>
>
> Patch looks good to me. Current error message looks ok to me.
> Do we need to add double quotes for RESTART word in the error message since it is an option?

Thanks for taking a look at the patch. Looks like the other options
are used in the error message without quotes, see
"MINVALUE (%s) is out of range for sequence data type
"START value (%s) cannot be less than MINVALUE
"RESTART value (%s) cannot be less than MINVALUE
"CACHE (%s) must be greater than zero

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-04-08 10:38:14 Re: Replication slot stats misgivings
Previous Message Amit Kapila 2021-04-08 10:30:29 Re: Replication slot stats misgivings