pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
strange behaviour of gettimeofday() and pg_dump
2+ messages / 1 participants
[nested] [flat]

* strange behaviour of gettimeofday() and pg_dump
@ 2001-11-06 17:57  Radoslaw Stachowiak <radek@alter.pl>
  0 siblings, 0 replies; 2+ messages in thread

From: Radoslaw Stachowiak @ 2001-11-06 17:57 UTC (permalink / raw)
  To: pgsql-admin

Intro data:
1. table with one (from many) columns:
 timestamp       | timestamp with time zone | not null default timeofday()

 used because I need better time resultion than just second provided by
 use of now().
2. pg_dump database > file

now, in such file, there are somtimes (it depends on specific data)
entries like this (only this column): 07:32:60  <- 60 seconds!

and such dump is useless for 'cat file|pgsql database' beacuse psql
refuses such entries.

Looks like that one of them (pg_dump or psql) should be fixed to match
the other. Please look, that column has strict type (timestamp with time zone)

this is postgresql 7.1.3 speaking ;-)

any help/info appreciated.

so far, I just correct this errors by hand before loading db (which
occurs very seldom). BTW, Ive seen entries like: 6:59:60, which are hard
to automated, because the change touches even an hour.

-- 
radoslaw.stachowiak.........................................http://alter.pl/



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

* strange behaviour of gettimeofday() and pg_dump
@ 2001-11-15 17:35  Radoslaw Stachowiak <radek@alter.pl>
  0 siblings, 0 replies; 2+ messages in thread

From: Radoslaw Stachowiak @ 2001-11-15 17:35 UTC (permalink / raw)
  To: pgsql-admin; +Cc: pgsql-devel@postgresql.org

OK, once more post about the subject, because after some investigation
it looks like a real and serious postgres bug. (7.1.3)

table definition with one (from many) columns:

 timestamp       | timestamp with time zone | not null default timeofday()

and the query:
db=# select timestamp,extract( seconds from timestamp) from history where id=274259;
                  timestamp         | date_part
		 ---------------------------+-----------
		  2001-09-22 20:07:60.00+02 | 59.998003
		  (1 row)

as You can see, first alement shows 60.00 which is WRONG!
at first sight i thought its average, but its not -> 60.00 !!! (two zeroes after decimal period)

it causes failures at pg_dump and shows that postgres has broken timestamp type.

or maybe i don't understand sth ? 

-- 
radoslaw.stachowiak.........................................http://alter.pl/



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


end of thread, other threads:[~2001-11-15 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-06 17:57 strange behaviour of gettimeofday() and pg_dump Radoslaw Stachowiak <radek@alter.pl>
2001-11-15 17:35 strange behaviour of gettimeofday() and pg_dump Radoslaw Stachowiak <radek@alter.pl>

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