Timestamp problem

Timestamp problem

Postby Thomas » Wed 27 Jul 2005 08:00

Hi,

I'm trying to display a timestamp column in a textbox on a form through databinding. Unfortunately rowtimetz and rowtime always shows 01.01.2000 00:00:00 instead of their real values. Only rowdate shows the correct date.

We are using an autogenerated dataset through pgSqlAdapter.

Our table looks like this

CREATE TABLE t_datetest
(
rowid bigserial NOT NULL,
rowtimetz timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) with time zone,
rowtime timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) without time zone,
rowdate date NOT NULL DEFAULT (('now'::text)::date + 14),
rowtxt varchar(256),
CONSTRAINT primkey PRIMARY KEY (rowid)
)
WITH OIDS;
ALTER TABLE t_datetest OWNER TO postgres;

INSERT INTO t_datetest(rowtxt) VALUES('test');

This Problem occurs with Version 2.10 and 2.11. We use Postgres 8.0.3 on FreeBSD.

Any help is really appreciated.

Regards
Thomas
Thomas
 

Timestamp problem

Postby Yuri » Wed 27 Jul 2005 12:28

We were unable to reproduce the problem. Can you obtain wrong values with reader.GetValue()?
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07

Postby Thomas » Mon 01 Aug 2005 10:19

Yes, we obtain the same wrong values with reader.GetValue().
We can reproduce the problem on different Computers.

What can I do to help you to reproduce the problem? What other
information do you need?

Regards
Thomas
Thomas
 

Timestamp problem

Postby Yuri » Tue 02 Aug 2005 09:16

Please specify the "Locale and Formatting" settings in postgresql.conf and regional options at the client side.
As a temporary solution you can use text protocol setting "protocol=2;" option at your ConnectionString.
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07

Postby Thomas » Tue 02 Aug 2005 14:47

Using protocol=2 works.

Locale and Formatting settings in postgresql.conf
# - Locale and Formatting -

#datestyle = 'iso, mdy'
#timezone = unknown # actually, defaults to TZ environment setting
#australian_timezones = false
#extra_float_digits = 0 # min -15, max 2
#client_encoding = sql_ascii # actually, defaults to database encoding

# These settings are initialized by initdb -- they might be changed
lc_messages = 'C' # locale for system error message strings
lc_monetary = 'C' # locale for monetary formatting
lc_numeric = 'C' # locale for number formatting
lc_time = 'C' # locale for time formatting


Enviroment:
LESSOPEN=|lesspipe.sh %s
INPUTRC=/etc/inputrc
MACHTYPE=i386
USER=pgsql
MAIL=/var/mail/pgsql
HOSTNAME=postgres.company.de
SHLVL=1
VENDOR=intel
LESS=-sM
HOME=/usr/local/pgsql
GZIP=-9
PGLIB=/usr/local/lib
PAGER=/usr/bin/less -sM
NNTPSERVER=news
COLORTERM=1
GROUP=pgsql
INFOPATH=/usr/share/info:/usr/local/info
INFODIR=/usr/share/info:/usr/local/info
LOGNAME=pgsql
MORE=
BLOCKSIZE=K
PGSYSCONFDIR=/usr/local/etc/postgresql
PGLOCALEDIR=/usr/local/share/locale
LESSCHARSET=latin1
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/pgsql/bin:/usr/opt/bin XFILESEARCHPATH=/var/X11R6/app-defaults/:/usr/X11R6/lib/X11/app-defaults/
HOST=postgres
SHELL=/bin/csh
CSHEDIT=emacs
XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults/
OSTYPE=FreeBSD
PWD=/usr/local/pgsql
PGDATA=/usr/local/pgsql/data
YARDHOME=/home/yard
FTP_PASSIVE_MODE=YES
HOSTTYPE=FreeBSD
Thomas
 

Timestamp problem

Postby Yuri » Wed 03 Aug 2005 13:05

We couldn't reproduce the problem.
Please send us complete small sample to demonstrate it.
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07


Return to dotConnect for PostgreSQL