Postgresql tree data structure

I installed Postgresql 9.2 and would like to use the LTREE data type. When I try to create a table, as in the documentation.

CREATE TABLE test (path ltree); 

I have an error: type ltree does not exist
I am using pgAdmin III for this request. What am I doing wrong? Install this module separately. If so, how?
Postscript Windows OS.

+7
source share
1 answer

You need to install the ltree extension by doing:

 CREATE EXTENSION ltree; 

as superuser.

See the manual for more details: http://www.postgresql.org/docs/current/static/sql-createextension.html

You can also read recursive queries that allow you to query such a data structure in a "regular table" using parent_id

+13
source

All Articles