Extensibility on PostgreSQL

I created my own R-tree: "rtree.h"

I want to create an extension in postgres with my own data structure (using PostGis), have already read about Interaction of extensions to indexes and now I read a few examples here , but to be honest, I don’t understand how I can use my own R-Tree To create Extensibility, I understand the concepts of operators, indexes, etc. But I do not know how to do this.

So, how can I connect my file to PostGis and then create extensibility on PostgreSQL?

Since extensions are functions, let's say one example on the PostgreSQL website:

CREATE OR REPLACE FUNCTION my_consistent(internal, data_type, smallint, oid, internal)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;

How it works? MODULE_PATHNAME is equal to /path/rtree.h?

+4
1

, C postgres, , 'MODULE PATHNAME' rtree.so Linux , , dll Windows. C SQL Postgres.

R-Tree GIST, . , R-Tree.c, , GIST. , - r- Postgres, , g- B-, : https://github.com/postgres/postgres/tree/master/contrib/btree_gist.


+2

Source: https://habr.com/ru/post/1610470/


All Articles