Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

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

CREATE TABLE test (path ltree);

I have error: type ltree does not exist
I use pgAdmin III for this query. What am I doing wrong? Should I install this module separately. If yes, how?
P.S. OS Windows.

share|improve this question
up vote 9 down vote accepted

You need to install the ltree extension by running:

CREATE EXTENSION ltree;

as a superuser.

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

You might also want to read up on recursive queries which let query this kind of data structure in a "regular table" using a parent_id

share|improve this answer
    
Thank you. It works. – Alex Jun 12 '13 at 12:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.