You don't need to use a bigint, read the documentation on data types.
There are a number of different things you can use for a timestamp, here
are a few :
abstime with timezone
timestamp with timezone
Then when you are inserting your data, you can use 'now' as the time.
CREATE TABLE pointy_stuff (
INSERT INTO pointy_stuff (
) VALUES (
I believe abstime is the smallest timestamp, but I could be wrong.
To output the data as a bigint I believe you can use this.
date_part('epoch',CreateTime) as unix_ts
Hope that helps.
Pradeepkumar, Pyatalo (IE10) wrote:
>I am having a table something like this....
>CREATE TABLE(PointId integer, PointName varchar(50),PointType integer,
>where createtime is the current timestamp when the tuple is inserted.
>now how do I insert values into the above table. Is there a way to cast
>timestamp to bigint.
>Also can anyone suggest as to which date function to use -
>CURRENT_TIMESTAMP, LOCALTIMESTAMP, timeofday(), now....
In response to
pgsql-novice by date
|Next:||From: Sean Davis||Date: 2004-08-13 14:47:08|
|Subject: Re: Query output|
|Previous:||From: Eduardo Vázquez Rodríguez||Date: 2004-08-13 14:22:58|
|Subject: Query output|
pgsql-sql by date
|Next:||From: Pentilian||Date: 2004-08-13 16:05:39|
|Subject: Re: Wierd Error on update|
|Previous:||From: Philippe Lang||Date: 2004-08-13 08:52:11|
|Subject: Re: function expression in FROM may not refer to other relations of same query level |