Re: upcasting multiplication in a query - Mailing list pgsql-sql

From Tom Lane
Subject Re: upcasting multiplication in a query
Date
Msg-id 8287.1047934315@sss.pgh.pa.us
Whole thread Raw
In response to upcasting multiplication in a query  ("John Guthrie" <jguthrie@psynapsetech.net>)
List pgsql-sql
"John Guthrie" <jguthrie@psynapsetech.net> writes:
>   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?

Cast the constant to int8.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: btree_gist, gint4_union
Next
From: Itai Zukerman
Date:
Subject: Re: btree_gist, gint4_union