Re: [SQL] bigint and unix time

2011-08-16 Thread Janiv Ratson
061500;131085;1313442000 Thanks, Janiv, -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Monday, August 15, 2011 17:14 To: Janiv Ratson Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] bigint and unix time On Sunday, August 14, 2011 11:23:08 pm Janiv Rats

Re: [SQL] bigint and unix time

2011-08-16 Thread Janiv Ratson
;)) AND extract(epoch from (date 'now')); Thanks a lot again, Janiv. -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Monday, August 15, 2011 17:14 To: Janiv Ratson Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] bigint and unix time On Sund

Re: [SQL] bigint and unix time

2011-08-16 Thread Janiv Ratson
Hi Adrain and thank you, Trac 0.12 uses microseconds as time value. What do you suggest? Thanks, Janiv. -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Monday, August 15, 2011 17:14 To: Janiv Ratson Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] bigint and

Re: [SQL] bigint and unix time

2011-08-16 Thread Adrian Klaver
On Tuesday, August 16, 2011 2:12:52 am Janiv Ratson wrote: > Hi Adrain and thank you, > Trac 0.12 uses microseconds as time value. > What do you suggest? extract(epoch ..) returns seconds which you are trying to compare to microseconds. The solution would be to divide your 'time' values by 1,000,

Re: [SQL] bigint and unix time

2011-08-15 Thread Janiv Ratson
t: Sunday, August 14, 2011 20:57 To: pgsql-sql@postgresql.org Cc: Janiv Ratson Subject: Re: [SQL] bigint and unix time On Sunday, August 14, 2011 4:13:30 am Janiv Ratson wrote: > Hi, > > > > I have the following query: > > > > select ticket as ticket, time as created

Re: [SQL] bigint and unix time

2011-08-15 Thread Adrian Klaver
On Sunday, August 14, 2011 11:23:08 pm Janiv Ratson wrote: > Hi and thanks, > If my 'time' column is being saved as bigint: 128732389900. > How do I write a query to check if the 'time' field is greater than now - > 30 (past 30 days)? So what you want is not what values are greater than some p

Re: [SQL] bigint and unix time

2011-08-14 Thread Adrian Klaver
On Sunday, August 14, 2011 4:13:30 am Janiv Ratson wrote: > Hi, > > > > I have the following query: > > > > select ticket as ticket, time as created, author as reporter, > cast(extract(epoch from (date 'now' - integer '30')) as bigint) > > from ticket_change tc > > where field = 'status' >

[SQL] bigint and unix time

2011-08-14 Thread Janiv Ratson
Hi, I have the following query: select ticket as ticket, time as created, author as reporter, cast(extract(epoch from (date 'now' - integer '30')) as bigint) from ticket_change tc where field = 'status' and newvalue = 'reopened' and time > extract(epoch from (date 'now' - integer '30')