pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Timestamp Fractions Problem
6+ messages / 2 participants
[nested] [flat]

* Timestamp Fractions Problem
@ 2002-09-13 14:38  Florian Mader <florian_mader@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Florian Mader @ 2002-09-13 14:38 UTC (permalink / raw)
  To: pgsql-sql

Hello,

I have got a really big problem with queries for Timestamp-Values.

	select mod_ from TMODUL 

This query, sent to a DBII returns the value 

	2002-09-11 17:47:30.017000

The same query sent to a PostgreSQL returns the value

	2002-09-11 17:47:30

I know that the fractions are also stored in the PostgreSQL, because the
query

	select to_char(mod_, 'YYYY-MM-DD HH24:MI:SS.US') from TMODUL

returns also

	2002-09-11 17:47:30.017000

What's the property I have to set, so that an ordinary "select mod_ from
TMODUL" also returns fractions?

Platform Info
OS: Win2000
Emulator: cygWin
PostgreSQL: 7.2.1

Does anybody have an idea?
TIA
Florian 




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

* Timestamp Fractions Problem
@ 2002-09-13 14:49  Florian Mader <florian_mader@gmx.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Florian Mader @ 2002-09-13 14:49 UTC (permalink / raw)
  To: pgsql-sql

Hello,
 
I have got a really big problem with queries for Timestamp-Values.
 
      select mod_ from TMODUL 
 
This query, sent to a DBII returns the value 
 
      2002-09-11 17:47:30.017000
 
The same query sent to a PostgreSQL returns the value
 
      2002-09-11 17:47:30
 
I know that the fractions are also stored in the PostgreSQL, because the
query
 
      select to_char(mod_, 'YYYY-MM-DD HH24:MI:SS.US') from TMODUL
 
returns also
 
      2002-09-11 17:47:30.017000
 
What's the property I have to set, so that an ordinary "select mod_ from
TMODUL" also returns fractions?
 
Platform Info
OS: Win2000
Emulator: cygWin
PostgreSQL: 7.2.1
 
Does anybody have an idea?
TIA
Florian
 
 

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

* Re: Timestamp Fractions Problem
@ 2002-09-14 03:35  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Florian Mader <florian_mader@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2002-09-14 03:35 UTC (permalink / raw)
  To: Florian Mader <florian_mader@gmx.net>; +Cc: pgsql-sql

"Florian Mader" <florian_mader@gmx.net> writes:
> I have got a really big problem with queries for Timestamp-Values.
>       select mod_ from TMODUL 
> This query, sent to a DBII returns the value 
>       2002-09-11 17:47:30.017000
> The same query sent to a PostgreSQL returns the value
>       2002-09-11 17:47:30

Around here I get

regression=# select mod_ from TMODUL ;
ERROR:  Relation "tmodul" does not exist

If I guess about what you meant then I get:

regression=# create table TMODUL(mod_ timestamp);
CREATE TABLE
regression=# insert into TMODUL values (now());
INSERT 1062096 1
regression=# select mod_ from TMODUL ;
            mod_
----------------------------
 2002-09-13 23:33:53.516852
(1 row)

Perhaps you should be a tad more specific about how your table is
declared and what you are doing to put data into it.

			regards, tom lane

PS: could we also ask you to suppress HTML output from your mailer?



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

* Re: Timestamp Fractions Problem
@ 2002-09-15 09:00  Florian Mader <florian_mader@gmx.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Florian Mader @ 2002-09-15 09:00 UTC (permalink / raw)
  To: pgsql-sql

Thank you Tom for the reply!
Now I tried the same create, insert and select statement you did. But
the DB didn't return fractions like it did in your case. I only got this
mod_                
------------------- 
2002-09-14 10:45:32
I am using WinSQL and the ODBC Driver I found on
http://odbc.postgresql.org 
Are there any special settings needed for the ODBC Driver? They are
currently set to default. 
TIA Florian




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

* Re: Timestamp Fractions Problem
@ 2002-09-15 14:51  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Florian Mader <florian_mader@gmx.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2002-09-15 14:51 UTC (permalink / raw)
  To: Florian Mader <florian_mader@gmx.net>; +Cc: pgsql-sql

"Florian Mader" <florian_mader@gmx.net> writes:
> Now I tried the same create, insert and select statement you did. But
> the DB didn't return fractions like it did in your case.

Hm, what PG version are you running?  You need 7.2 or later to have full
support for fractional timestamps (in particular, the result of now() is
only good to the nearest second in prior versions).

			regards, tom lane



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

* Re: Timestamp Fractions Problem
@ 2002-09-16 08:29  Florian Mader <florian_mader@gmx.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Florian Mader @ 2002-09-16 08:29 UTC (permalink / raw)
  To: pgsql-sql

I am using:
PostgreSQL 7.2.2
ODBC Driver 7.02.00.02
Cygwin 1.3.12-2
Win2000 5.00.2195 SP2
WinSQL 3.8.19.499

I don't think that there's a problem with my versions.
Do you have any other idea?
TIA

-----Ursprüngliche Nachricht-----
Von: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Gesendet: Sonntag, 15. September 2002 16:52
An: Florian Mader
Cc: pgsql-sql@postgresql.org
Betreff: Re: [SQL] Timestamp Fractions Problem 

"Florian Mader" <florian_mader@gmx.net> writes:
> Now I tried the same create, insert and select statement you did. But
> the DB didn't return fractions like it did in your case.

Hm, what PG version are you running?  You need 7.2 or later to have full
support for fractional timestamps (in particular, the result of now() is
only good to the nearest second in prior versions).

			regards, tom lane




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


end of thread, other threads:[~2002-09-16 08:29 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-13 14:38 Timestamp Fractions Problem Florian Mader <florian_mader@gmx.net>
2002-09-13 14:49 Timestamp Fractions Problem Florian Mader <florian_mader@gmx.net>
2002-09-14 03:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-09-15 09:00 Re: Timestamp Fractions Problem Florian Mader <florian_mader@gmx.net>
2002-09-15 14:51 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-09-16 08:29   ` Florian Mader <florian_mader@gmx.net>

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