Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Oleg Bartunov
Look at contrib/ltree http://www.sai.msu.su/~megera/postgres/gist/ltree Oleg On Fri, 9 Jan 2004 [EMAIL PROTECTED] wrote: > Hello everybody! > > Does someone know how to build hierarchical queries to the postgresql? > > I have a table with tree in it (id, parent) > and need to find a way f

[GENERAL] query should use an index?

2004-01-10 Thread Bopolissimus Platypus
hello, i've got a table that looks like this (irrelevant data removed); create table test ( id serial primary key, t_end timestamp); there's an index: create index test_t_end on test(t_end); can or should a query like: select login,t_end from test order by t_end desc; use the index? e

Re: [GENERAL] query should use an index?

2004-01-10 Thread Peter Eisentraut
Bopolissimus Platypus wrote: > create table test ( > id serial primary key, > t_end timestamp); > > there's an index: > create index test_t_end on test(t_end); > > can or should a query like: > > select login,t_end from test order by t_end desc; > > use the index? It can, but that does not

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Anton . Nikiforov
Hello and thanks for the links, but >> http://www.brasileiro.net/postgres/cookbook. this site is still down or at least do not accsepting requests, and RH> http://gppl.terminal.ru/index.eng.html this patch is not working with my 7.4 release, i tried hier-0.3, but cannot compile my postgres with

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Anton . Nikiforov
Hello Oleg and thanks for the link, but i could not understand how to get path from one point of the tree to another? Anyway thanks :) Best regards, Anton OB> Look at contrib/ltree OB> http://www.sai.msu.su/~megera/postgres/gist/ltree OB> Oleg OB> On Fri, 9 Jan 2004 [EMAIL PROTECTED] wrot

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Oleg Bartunov
On Sat, 10 Jan 2004 [EMAIL PROTECTED] wrote: > Hello Oleg and thanks for the link, but i could not understand how to > get path from one point of the tree to another? have you read documentation ? Get all childrens - ltree <@ ltree, for example: ltreetest=# select path from test where path <@ 'T

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Anton . Nikiforov
Hello Oleg! There is no data yet, i'm just planning to start a new project :) Text labels are just fine and i red the documentation from the top to the very end a few times and found the way to use your module, but using it will not as beautiful as i was planning mathematicaly. You know i have (pla

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Joe Conway
[EMAIL PROTECTED] wrote: RH> I could have sworn there was something in contrib/ too, but I can't see it RH> now. Yes it is gone. :) See contrib/tablefunc for a function called connectby(). Joe ---(end of broadcast)--- TIP 5: Have you checked our ex

[GENERAL] Bug in functions returning setof where table has dropped column?

2004-01-10 Thread Stephen Quinney
I really cannot tell if this is a bug or I am just doing something stupid. I create a table called wibble: CREATE TABLE wibble (a integer, b integer); I insert some data: INSERT INTO wibble VALUES (1,1); I decide that actually I want column b to be a BIGINT, so I do: ALTER TABLE wibble ADD

Re: [GENERAL] no space left on device

2004-01-10 Thread Bruno Wolff III
On Sat, Jan 10, 2004 at 00:38:43 +, "Nigel J. Andrews" <[EMAIL PROTECTED]> wrote: > > On Sat, 10 Jan 2004, Nigel J. Andrews wrote: > > And a common culprit is whatever is being used for usenet caching/serving...or > > ordinary mail which is just accumulating in /var/mail (or whereever). > >

Re: [GENERAL] Bug in functions returning setof where table has dropped column?

2004-01-10 Thread Tom Lane
Stephen Quinney <[EMAIL PROTECTED]> writes: > I have written a function which shows fairly simply my problem. > CREATE FUNCTION foobar() RETURNS SETOF wibble AS > 'SELECT * FROM wibble' LANGUAGE SQL; > Doing 'select * from foobar();' gives me the error: > ERROR: query-specified return row and ac

Re: [GENERAL] postgresql dies without saying why

2004-01-10 Thread Tom Lane
Robin Lynn Frank <[EMAIL PROTECTED]> writes: > The following appears when the machine is booted, but somehow postgresql > silently dies (no message in logs). If I then use the same init script that > is used during startup, it starts just fine and keeps running. Any thoughts > on how I can det

[GENERAL] Bug with rename bigserial column

2004-01-10 Thread D. Dante Lorenso
I just ran into a dump/restore problem with a bigserial column on a renamed table. BIGSERIAL columns when created will automagically create the sequence also. The sequence name is derived from the table name and column name. I had a table named 'audio_usage' and defined a column like this: a

[GENERAL] Problem with date calculations

2004-01-10 Thread Cornelia Boenigk
Hi alltogether I have a table with two fields, d1 timestamp and dur smallint. d1 is the starting date and dur is the duration. From this two fields I want to generate future dates for the whole table. There is no problem with queries where a number for the duration is given. test=# select d1,dur,

Re: [GENERAL] Problem with date calculations

2004-01-10 Thread Stephan Szabo
On Sat, 10 Jan 2004, Cornelia Boenigk wrote: > I have a table with two fields, d1 timestamp and dur smallint. > d1 is the starting date and dur is the duration. From this two fields > I want to generate future dates for the whole table. I'd suggest using something like: d1 + dur * interval '1 m

Re: [GENERAL] Problem with date calculations

2004-01-10 Thread Cornelia Boenigk
Hi Stephan Thank you > d1 + dur * interval '1 month' works ;-) Regards Conni ---(end of broadcast)--- TIP 8: explain analyze is your friend