Обсуждение: Timestamp Fractions Problem

Поиск
Список
Период
Сортировка

Timestamp Fractions Problem

От
"Florian Mader"
Дата:

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

 

 

Re: Timestamp Fractions Problem

От
Tom Lane
Дата:
"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?


Re: Timestamp Fractions Problem

От
"Florian Mader"
Дата:
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



Re: Timestamp Fractions Problem

От
Tom Lane
Дата:
"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


Re: Timestamp Fractions Problem

От
"Florian Mader"
Дата:
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