Re: CREATE SEQUENCE with RESTART option

From: Cary Huang <cary(dot)huang(at)highgo(dot)ca>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Subject: Re: CREATE SEQUENCE with RESTART option
Date: 2021-07-23 21:49:24
Message-ID: 162707696401.1159.4114334221450629316.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, passed
Documentation: tested, passed

Hi

I have applied and run your patch, which works fine 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 if RESTART option is
* specified. However, it can be used with ALTER SEQUENCE.
*/

I would remove the first sentence, because it seems like a personal opinion to me. I am sure someone, somewhere may think it makes total sense :).

I would rephrase like this:

/*
* Allowing both START and RESTART option for CREATE SEQUENCE
* could override the START value and cause confusion to user. Hence,
* we throw an error for CREATE SEQUENCE if RESTART option is
* specified; it can only be used with ALTER SEQUENCE.
*/

just a thought.

thanks!

-------------------------------------
Cary Huang
HighGo Software Canada
www.highgo.ca

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-07-23 21:51:42 Re: Configure with thread sanitizer fails the thread test
Previous Message Tom Lane 2021-07-23 21:47:27 Re: Followup Timestamp to timestamp with TZ conversion