upcasting multiplication in a query

From: "John Guthrie" <jguthrie(at)psynapsetech(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: upcasting multiplication in a query
Date: 2003-03-17 20:21:29
Message-ID: 037901c2ecc2$cea38a30$3dc810ac@corphq.psynapsetech.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

i have a schema that stores timestamps in seconds/microseconds format. each
column in the table is int4. what i want to do is to compute the int8 value
of total microseconds, a la:
select (seconds*1000000)+micros from my_table;
but it looks to me like postgresql puts the rresult into another int4 (since
i am getting negative numbers, i assume overflow). how can i get it to use
int8?

thanks.
---
john guthrie
jguthrie(at)psynapsetech(dot)net

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-03-17 20:30:40 Re: Poor performance on a right join
Previous Message Bruce Momjian 2003-03-17 19:59:46 Re: btree_gist, gint4_union