Re: Sequence Access Method WIP

Petr Jelinek <petr@2ndquadrant.com>

From: Petr Jelinek <petr@2ndquadrant.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>, Simon Riggs <simon@2ndQuadrant.com>
Cc: Andres Freund <andres@2ndquadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Alvaro Herrera <alvherre@2ndquadrant.com>
Date: 2015-01-12T21:33:39Z
Lists: pgsql-hackers

Attachments

On 15/12/14 11:36, Petr Jelinek wrote:
> On 10/12/14 03:33, Petr Jelinek wrote:
>> On 24/11/14 12:16, Heikki Linnakangas wrote:
>>
>> About the rough edges:
>> - The AlterSequence is not prettiest code around as we now have to
>> create new relation when sequence AM is changed and I don't know how to
>> do that nicely
>> - I am not sure if I did the locking, command order and dependency
>> handling in AlterSequence correcly
>
> This version does AlterSequence differently and better. Didn't attach
> the gapless sequence again as that one is unchanged.
>
>

And another version, separated into patch-set of 3 patches.
First patch contains the seqam patch itself, not many changes there, 
mainly docs/comments related. What I wrote in the previous email for 
version 3 still applies.

Second patch adds DDL support. I originally wanted to make it 
CREATE/DROP SEQUENCE ACCESS METHOD... but that would mean making ACCESS 
a reserver keyword so I went for CREATE ACCESS METHOD FOR SEQUENCES 
which does not need to change anything (besides adding METHOD to 
unreserved keywords).
The DDL support uses the DefineStmt infra with some very small change as 
the sequence ams are not schema qualified, but I think it's acceptable 
and saves considerable amount of boilerplate.

And third patch is gapless sequence implementation updated to work with 
the new DDL support with some tests added for checking if dependencies 
work correctly. It also acts as example on how to make custom AMs.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services

Commits

  1. Add missing gss option to msvc config template