diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-01-19 15:41:44 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-01-19 15:42:13 +0100 |
commit | 6db4598fcb82a87a683c4572707e522504830a2b (patch) | |
tree | 0a1b90ad4c3919e95cc72ba9a6754c6e39a8ef9d /src/backend/access/gist/gistvalidate.c | |
parent | b725b7eec431f7394d63abe621170efe3fcdcda4 (diff) | |
download | postgresql-6db4598fcb82a87a683c4572707e522504830a2b.tar.gz postgresql-6db4598fcb82a87a683c4572707e522504830a2b.zip |
Add stratnum GiST support function
This is support function 12 for the GiST AM and translates
"well-known" RT*StrategyNumber values into whatever strategy number is
used by the opclass (since no particular numbers are actually
required). We will use this to support temporal PRIMARY
KEY/UNIQUE/FOREIGN KEY/FOR PORTION OF functionality.
This commit adds two implementations, one for internal GiST opclasses
(just an identity function) and another for btree_gist opclasses. It
updates btree_gist from 1.7 to 1.8, adding the support function for
all its opclasses.
Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com
Diffstat (limited to 'src/backend/access/gist/gistvalidate.c')
-rw-r--r-- | src/backend/access/gist/gistvalidate.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/access/gist/gistvalidate.c b/src/backend/access/gist/gistvalidate.c index 7e2a715200a..698e01ed2f7 100644 --- a/src/backend/access/gist/gistvalidate.c +++ b/src/backend/access/gist/gistvalidate.c @@ -147,6 +147,10 @@ gistvalidate(Oid opclassoid) ok = check_amproc_signature(procform->amproc, VOIDOID, true, 1, 1, INTERNALOID); break; + case GIST_STRATNUM_PROC: + ok = check_amproc_signature(procform->amproc, INT2OID, true, + 1, 1, INT2OID); + break; default: ereport(INFO, (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), @@ -267,7 +271,8 @@ gistvalidate(Oid opclassoid) continue; /* got it */ if (i == GIST_DISTANCE_PROC || i == GIST_FETCH_PROC || i == GIST_COMPRESS_PROC || i == GIST_DECOMPRESS_PROC || - i == GIST_OPTIONS_PROC || i == GIST_SORTSUPPORT_PROC) + i == GIST_OPTIONS_PROC || i == GIST_SORTSUPPORT_PROC || + i == GIST_STRATNUM_PROC) continue; /* optional methods */ ereport(INFO, (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), @@ -339,6 +344,7 @@ gistadjustmembers(Oid opfamilyoid, case GIST_FETCH_PROC: case GIST_OPTIONS_PROC: case GIST_SORTSUPPORT_PROC: + case GIST_STRATNUM_PROC: /* Optional, so force it to be a soft family dependency */ op->ref_is_hard = false; op->ref_is_family = true; |