Re: CREATE SEQUENCE with RESTART option - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CREATE SEQUENCE with RESTART option
Date
Msg-id 593745.1627492579@sss.pgh.pa.us
Whole thread Raw
In response to Re: CREATE SEQUENCE with RESTART option  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: CREATE SEQUENCE with RESTART option  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Fujii Masao <masao.fujii@oss.nttdata.com> 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 throwing errorConflictingDefElem or errmsg("START and
>> RESTART are mutually exclusive options"). We do throw these errors in
>> a lot of other places for various options. Others may have better
>> thoughts though.

> Per docs, CREATE SEQUENCE conforms to the SQL standard, with some exceptions.
> So I'd agree with Michael if CREATE SEQUENCE with RESTART also conforms to
> the SQL standard, but I'd agree with Bharath otherwise.

I do not see any RESTART option in SQL:2021 11.72 <sequence generator
definition>.  Since we don't document it either, there's really no
expectation that anyone would use it.

I don't particularly think that we should document it, so I'm with Michael
that we don't need to do anything.  This is hardly the only undocumented
corner case in PG.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Have I found an interval arithmetic bug?
Next
From: Fujii Masao
Date:
Subject: Re: Fix around conn_duration in pgbench