From: dev@archonet.com
To: John Guthrie <jguthrie@psynapsetech.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: upcasting multiplication in a query
Date: Mon, 17 Mar 2003 20:35:06 -0000 (GMT)
Message-ID: <49174.192.168.1.32.1047933306.squirrel@mainbox.archonet.com> (raw)
In-Reply-To: <037901c2ecc2$cea38a30$3dc810ac@corphq.psynapsetech.net>
References: <037901c2ecc2$cea38a30$3dc810ac@corphq.psynapsetech.net>
> 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?
Try (seconds::int8 * 10000000)+micros - you could use cast(...) if you
want to be more standard.
- Richard Huxton
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, jguthrie@psynapsetech.net
Subject: Re: upcasting multiplication in a query
In-Reply-To: <49174.192.168.1.32.1047933306.squirrel@mainbox.archonet.com>
* 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