Thread: Special Date/Time Inputs
Hi How do you use Special Date/Time Inputs described in Table 5.14 (Postgresql documentation)? It looks like only now() works. When I try to select epoch() I get error, that such function doesn't exist. Anyway it came from another problem: I have table with millions records indexed on timestamp. I tried to speed up using this table, so I changed timestamp into seconds-since-epoch (integer). What do you think about it? Is there a better way to convert this field back into timestamp than '1970-01-01'::timestamp+cast(field || ' seconds' as interval) ? Regards, Tomasz Myrta
On Mon, 17 Feb 2003, Tomasz Myrta wrote: > Hi > How do you use Special Date/Time Inputs described in Table 5.14 > (Postgresql documentation)? > It looks like only now() works. When I try to select epoch() I get > error, that such function doesn't exist. > Try, http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-datetime.html regards, bhuvaneswaran
A.Bhuvaneswaran wrote: > On Mon, 17 Feb 2003, Tomasz Myrta wrote: > > >>Hi >>How do you use Special Date/Time Inputs described in Table 5.14 >>(Postgresql documentation)? >>It looks like only now() works. When I try to select epoch() I get >>error, that such function doesn't exist. >> > > > Try, > > http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-datetime.html > > regards, > bhuvaneswaran I know this already - it works fine. I was talking about epoch() which should be equivalent of '1970-1-1'::timestamp Regards, Tomasz Myrta
A.Bhuvaneswaran wrote: > On Mon, 17 Feb 2003, Tomasz Myrta wrote: > > >>Hi >>How do you use Special Date/Time Inputs described in Table 5.14 >>(Postgresql documentation)? >>It looks like only now() works. When I try to select epoch() I get >>error, that such function doesn't exist. >> > > > Try, > > http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-datetime.html > > regards, > bhuvaneswaran Sorry, I didn't notice James Pye's example on the bottom. Thanks. Tomasz Myrta