pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
timestamp in 7.2
3+ messages / 3 participants
[nested] [flat]

* timestamp in 7.2
@ 2002-03-27 10:55 mark@vestnesis.lv
  2002-03-27 11:07 ` Re: timestamp in 7.2 Karel Zak <zakkr@zf.jcu.cz>
  2002-03-27 17:43 ` Re: timestamp in 7.2 Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 2 replies; 3+ messages in thread

From: mark@vestnesis.lv @ 2002-03-27 10:55 UTC (permalink / raw)
  To: pgsql-admin

Hello all.

I'v migrated my data to 7.2.
Now I'm  testing aplications, but looks like timestamp function in 
postgres is broken:
klienti=# select date(now());
    date
------------
 2002-03-27
(1 row)

klienti=# select timestamp(date(now()));
ERROR:  parser: parse error at or near "date"

I need to make querys with timestamp(date,time);
But timestamp don't work even with sample from manual:

klienti=# select timestamp(date '1998-02-24',time '23:07');
ERROR:  parser: parse error at or near "date"

Mark




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: timestamp in 7.2
  2002-03-27 10:55 timestamp in 7.2 mark@vestnesis.lv
@ 2002-03-27 11:07 ` Karel Zak <zakkr@zf.jcu.cz>
  1 sibling, 0 replies; 3+ messages in thread

From: Karel Zak @ 2002-03-27 11:07 UTC (permalink / raw)
  To: mark@vestnesis.lv; +Cc: pgsql-admin

On Wed, Mar 27, 2002 at 12:55:54PM +0200, mark@vestnesis.lv wrote:
> Hello all.
> 
> I'v migrated my data to 7.2.
> Now I'm  testing aplications, but looks like timestamp function in 
> postgres is broken:
> klienti=# select date(now());
>     date
> ------------
>  2002-03-27
> (1 row)
> 
> klienti=# select timestamp(date(now()));
> ERROR:  parser: parse error at or near "date"

 I thing better is use some cast method instead cast by function call:

test=# SELECT CAST( now() AS date ), now()::date, 'now'::date::timestamp;
    now     |    now     |      timestamptz
------------+------------+------------------------
 2002-03-27 | 2002-03-27 | 2002-03-27 00:00:00+01
(1 row)


> 
> I need to make querys with timestamp(date,time);
> But timestamp don't work even with sample from manual:
> 
> klienti=# select timestamp(date '1998-02-24',time '23:07');
> ERROR:  parser: parse error at or near "date"

test=# select date '1998-02-24' + time '23:07';
      ?column?
---------------------
 1998-02-24 23:07:00
(1 row)

test=# select timestamp '1998-02-24 23:07';
      timestamptz
------------------------
 1998-02-24 23:07:00+01
(1 row)


    Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: timestamp in 7.2
  2002-03-27 10:55 timestamp in 7.2 mark@vestnesis.lv
@ 2002-03-27 17:43 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Stephan Szabo @ 2002-03-27 17:43 UTC (permalink / raw)
  To: mark@vestnesis.lv; +Cc: pgsql-admin

On Wed, 27 Mar 2002 mark@vestnesis.lv wrote:

> Hello all.
>
> I'v migrated my data to 7.2.
> Now I'm  testing aplications, but looks like timestamp function in
> postgres is broken:
> klienti=# select date(now());
>     date
> ------------
>  2002-03-27
> (1 row)
>
> klienti=# select timestamp(date(now()));
> ERROR:  parser: parse error at or near "date"
>
> I need to make querys with timestamp(date,time);
> But timestamp don't work even with sample from manual:
>
> klienti=# select timestamp(date '1998-02-24',time '23:07');
> ERROR:  parser: parse error at or near "date"

timestamp is more reserved than before, I believe it'll work as
"timestamp"(...).  The other form is now for specifying the precision
of a timestamp.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-03-27 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-03-27 10:55 timestamp in 7.2 mark@vestnesis.lv
2002-03-27 11:07 ` Karel Zak <zakkr@zf.jcu.cz>
2002-03-27 17:43 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>

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