Re: CREATE SEQUENCE with RESTART option

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: 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-07 13:21:49
Message-ID: CALj2ACUnMTSo7oGj8U+VSnOQ5=1E+QWpUY+gqyMWmi73tWfF_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 7, 2021 at 6:04 PM Ashutosh Bapat
<ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> 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 RESTART in CREATE
SEQUENCE. If required, users will run ALTER SEQUENCE RESTART
separately, that will be a clean way.

> Said all that I agree that if we are supporting CREATE SEQUENCE ...
> RESTART then we should document it, correctly. If that's not the
> intention, we should disallow RESTART with CREATE SEQUENCE.

As I mentioned upthread, it's better to disallow (throw error) if
RESTART is specified for CREATE SEQUENCE. Having said that, I would
like to hear from others.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-04-07 13:25:04 Re: Why is specifying oids = false multiple times in create table is silently ignored?
Previous Message Heikki Linnakangas 2021-04-07 13:18:53 Re: Yet another fast GiST build