Hello Liu!

> 21 апр. 2019 г., в 17:32, 梦旅人 <liubaozhu1...@qq.com> написал(а):
>    I want to add a feature in PostgreSQL, and I need use map structure and 
> set structure(like STL in C++). Do PostgreSQL have realized these structures? 
> Where can I find the functions?
>     What I need in the code is just like this:
>     map<char*, set<char*> >
>     set<char*>

You can use HTAB at utils/hsearch.h [0]

It is Larson's dynamic hashing, implementation is in 
backend/utils/hash/dynahash.c
Mostly like unordered_map. Accordingly, it lacks lower bound functionality as 
sorted sets do.

Also, you can user RB-tree in lib/rbtree.h [1] It's usual red-black tree.

Best regards, Andrey Borodin.


[0] https://github.com/postgres/postgres/blob/master/src/include/utils/hsearch.h
[1] https://github.com/postgres/postgres/blob/master/src/include/lib/rbtree.h

Reply via email to