public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Fabian Lindfors <[email protected]>
Cc: [email protected]
Subject: Re: Custom index access method for primary keys
Date: Mon, 07 Apr 2025 10:06:48 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Fabian Lindfors <[email protected]> writes:
> Hi! I’m working on an index access method that I intend to be
> generic and to replace btree for my specific use case. I noticed
> though that it doesn’t seem to be possible to specify an access
> method when creating a new table and using PRIMARY KEY.

There's some work going on right now to remove the core code's
assumptions that only btree can handle unique/pkey constraints
and sorting [1].  I'm not sure if it'll be entirely complete for
v18 but the goalposts have been moved quite far.  I think you can
probably expect to be able to do

	CREATE TABLE mytable ...;
	CREATE UNIQUE INDEX myindex ON mytable USING myam (...);
	ALTER TABLE mytable ADD PRIMARY KEY USING INDEX myindex;

It doesn't look like we yet allow direct "USING myam" in
PRIMARY KEY, but sooner or later we might get to that.

			regards, tom lane

[1] https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330%40enterprisedb.com






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Custom index access method for primary keys
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox