Re: upcasting multiplication in a query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John Guthrie" <jguthrie(at)psynapsetech(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: upcasting multiplication in a query
Date: 2003-03-17 20:51:55
Message-ID: 8287.1047934315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"John Guthrie" <jguthrie(at)psynapsetech(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Itai Zukerman 2003-03-17 21:06:40 Re: btree_gist, gint4_union
Previous Message Tom Lane 2003-03-17 20:50:32 Re: btree_gist, gint4_union