From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Paulo Roberto Kappke <paulok@cyclades.com.br>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Doubts in timespan
Date: Mon, 30 Aug 1999 18:19:12 +0300
Message-ID: <l03130302b3f04f90bc5e@[147.233.159.109]> (raw)
In-Reply-To: <37C53FD3.8410737A@cyclades.com.br>
At 16:23 +0300 on 26/08/1999, Paulo Roberto Kappke wrote:
> "UPDATE tasktime SET elapsed_time='age((SELECT inserted_time FROM
> tasktime WHERE row=$row),(SELECT inserted_time FROM tasktime WHERE
> row=$old_row))' WHERE row=$old_row"
If I'm not mistaken, Postgres does not allow subselects to be used in this
context. In any case the age function should not be in quotes...
Instead, the syntax Postgres uses from the days of old would be something like
UPDATE tasktime
SET elapsed_time = age( tt.inserted_time, inserted_time )
FROM tasktime tt
WHERE row=$old_row AND tt.row = $row;
This has nothing to do with timespan.
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
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: herouth@oumail.openu.ac.il, paulok@cyclades.com.br
Subject: Re: [SQL] Doubts in timespan
In-Reply-To: <l03130302b3f04f90bc5e@[147.233.159.109]>
References: <37C53FD3.8410737A@cyclades.com.br> <l03130302b3f04f90bc5e@[147.233.159.109]>
* 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