pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oleg Bartunov <oleg@sai.msu.su>
To: Evgen Potemkin <evgent@ns.terminal.ru>
Cc: pgsql-sql@postgresql.org, Teodor Sigaev <teodor@stack.net>
Subject: Re: Proposal of hierarchical queries, a la Oracle
Date: Sat, 16 Nov 2002 19:58:55 +0300 (MSK)
Message-ID: <Pine.GSO.4.44.0211161956560.18869-100000@ra.sai.msu.su> (raw)
In-Reply-To: <Pine.LNX.4.33.0211161449110.29721-100000@ns.terminal.ru>

Evgen,

read info about ltree module
http://www.sai.msu.su/~megera/postgres/gist/ltree/

Do you have implemented indexed access ?

	regards,

		Oleg

On Sat, 16 Nov 2002, Evgen Potemkin wrote:

> I was have made a module like ltree, i don't know how you implement it,
> but mine doesn't fit.
>
> The problem : for ex. you need to select a tree, but with childs of
> each parent is sorted.
> in my module i've defined a tree path as set of
> numbers separated by dot ('1.234.456.789'::hier for ex.), a comparision
> operators <,>,<=,<=,= , operators for checking for ancestors/descedants
> <<,>>,<<=,>>=.
> create table t (field text, node::hier);
> then i do "select field from t where where node <<'1' order by node";
> 'order by' - for tuples being in order of tree (first is root,then first
> child, then first child of first child, .. so on). works perfectly well.
>
> THE MATTER OF PROBLEM:
> tuples can't be sorted alphabetically by 'field', because of 'order by node'
> clause. 'order by node,field' doesn't really work because 'node' is first
> key, if 'order by field,node' - then we don't get a tree.
>
> if i do nodes on one level is equal, then childs of one node in some cases
> are migrate to another node of same level :) as far as i understand problem
> is in pg's sort. it's not a bug but feature of sort alghorithm.
>
> The minor problem is that such tree a bit difficult to maintain. for ex. if i need
> to move some node to elsewhere in tree, i need to update all childs, sub
> childs, ... of this node.
>
> regards
> ---
> .evgen
>
> On Fri, 15 Nov 2002, Oleg Bartunov wrote:
>
> > Evgen,
> >
> > you'd need to post your message and patch to hackers mailing list.
> > btw, did you try contrib/ltree module ?
> >
>
> > 	Regards,
> > 		Oleg
> > _____________________________________________________________
> > Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
> > Sternberg Astronomical Institute, Moscow University (Russia)
> > Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
> > phone: +007(095)939-16-83, +007(095)939-23-83
> >
> >
>

	Regards,
		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




view thread (11+ messages)  latest in thread

Message-ID: <Pine.GSO.4.44.0211161956560.18869-100000@ra.sai.msu.su>
Permalink:  ../Pine.GSO.4.44.0211161956560.18869-100000@ra.sai.msu.su/
Also on:    postgresql.org/message-id/Pine.GSO.4.44.0211161956560.18869-100000@ra.sai.msu.su

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: oleg@sai.msu.su, evgent@ns.terminal.ru, teodor@stack.net
  Subject: Re: Proposal of hierarchical queries, a la Oracle
  In-Reply-To: <Pine.GSO.4.44.0211161956560.18869-100000@ra.sai.msu.su>
  References: <Pine.LNX.4.33.0211161449110.29721-100000@ns.terminal.ru> <Pine.GSO.4.44.0211161956560.18869-100000@ra.sai.msu.su>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox