Appending to an array[] feild...[ ltree ]

From: "Rajesh Kumar Mallah(dot)" <mallah(at)trade-india(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Appending to an array[] feild...[ ltree ]
Date: 2002-09-21 04:45:09
Message-ID: 200209211015.09195.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi ,

We are undergoing a data consolidation process wherein we are making a common
repository of business profiles from various sources.

I require to store label paths like 1.1.1 , 1.1.2,1.1.3 etc in a feild
and i use ltree[] for fast searching.

The problem is in the ltree[] feild in need to store uniq paths and need
want to know if some utility functions exists.

For example if {1.1.1,1.1.2,1.1.3} is contained in a ltree[] record and i encounter
a path say 1.1.4 i need to update it to {1.1.1,1.1.2,1.1.3,1.1.4} in other words
i need to insert to the ltree[] feild. Does there exists any generic function
(or ltree[] specific function) to add an item in the array? (first question)

My another question is is there any way to matain uniqueness in a ltree[] feild
for example , suppose i now encounter {1.1.1} again i do not want to
update the record to {1.1.1,1.1.2,1.1.3,1.1.4,1.1.1} to want it to remain the same
ie,{1.1.1,1.1.2,1.1.3,1.1.4} becoz 1.1.1 is already present in the [] , does there
exists any function to probe an ltree[] feild for existance ?

Regards
Mallah.

--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.

Browse pgsql-sql by date

  From Date Subject
Next Message David Stanaway 2002-09-22 05:32:49 Is there a better way than this to get the start and end of a month?
Previous Message Josh Berkus 2002-09-20 21:55:30 Re: Performance w/ multiple WHERE clauses