Appending to an array[] feild...[ ltree ] - Mailing list pgsql-sql

From Rajesh Kumar Mallah.
Subject Appending to an array[] feild...[ ltree ]
Date
Msg-id 200209211015.09195.mallah@trade-india.com
Whole thread Raw
List 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.




pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Performance w/ multiple WHERE clauses
Next
From: David Stanaway
Date:
Subject: Is there a better way than this to get the start and end of a month?