Thread: tree-like structures in pgsql

tree-like structures in pgsql

From
"Angelica Garcia"
Date:
Hello *,

I would like to save a tree-like structure in a pgsql table. Can anyone give
me some suggestions about how can I achieve this task?

I will also appreciate any information that points to how to create new data
types in pgsql, if that is possible.

Thanks in advanced,
Angelica.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Re: tree-like structures in pgsql

From
Richard Broersma Jr
Date:
--- Angelica Garcia <doitviolet@hotmail.com> wrote:

> Hello *,
>
> I would like to save a tree-like structure in a pgsql table. Can anyone give
> me some suggestions about how can I achieve this task?
>
> I will also appreciate any information that points to how to create new data
> types in pgsql, if that is possible.

My understanding is that there are three popular ways to store trees in a table:
1) adjacency list model
http://www.sqlsummit.com/AdjacencyList.htm
2) path enumeration model
http://www.onlamp.com/pub/a/onlamp/2004/08/05/hierarchical_sql.html
3) nested set model
http://www.dbmsmag.com/9603d06.html

Each has strengths and weaknesses.  And each has a different method of querying hierarchical data.
Regards,
Richard Broersma Jr.

Arrow keys do not work while using psql

From
"Angelica Garcia"
Date:
Hello *.

I have a small problem: While using psql the arrow keys neither give command
history nor move the cursor. They instead show characters like: ^[[A.

I am working in a SuSe Linux 9.1 PC and the arrow keys work just fine in
Linux.

Any hint will be appreciated.

Angelica.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Re: Arrow keys do not work while using psql

From
Tom Lane
Date:
"Angelica Garcia" <doitviolet@hotmail.com> writes:
> I have a small problem: While using psql the arrow keys neither give command
> history nor move the cursor. They instead show characters like: ^[[A.

Wrong setting of TERM, maybe?

            regards, tom lane

Re: Arrow keys do not work while using psql

From
Oliver Elphick
Date:
On Tue, 2007-08-07 at 06:25 -0700, Angelica Garcia wrote:
> Hello *.
>
> I have a small problem: While using psql the arrow keys neither give command
> history nor move the cursor. They instead show characters like: ^[[A.
>
> I am working in a SuSe Linux 9.1 PC and the arrow keys work just fine in
> Linux.
>
> Any hint will be appreciated.

Your particular version of PostgreSQL has apparently not been built with
readline support.  This is a compile-time option.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Re: Arrow keys do not work while using psql

From
Michael Glaesemann
Date:
[Please start new threads with a new message. It appears you replied
to a previous post and just changed the subject. This causes message
threading issues in threaded mail clients and the mailing list
archives.]

On Aug 7, 2007, at 8:25 , Angelica Garcia wrote:

> I have a small problem: While using psql the arrow keys neither
> give command history nor move the cursor. They instead show
> characters like: ^[[A.

It sounds like Postgres was built without readline (or libedit)
support. You can use pg_config --libs to see if it was included. If
not, I believe you need to rebuild Postgres including readline.

Michael Glaesemann
grzm seespotcode net