Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: Cannot get date fields to import from PostgreSQL via ODBC


From   Dave Ewart <davee@ceu.ox.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: Cannot get date fields to import from PostgreSQL via ODBC
Date   Wed, 28 Sep 2005 16:12:42 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday, 28.09.2005 at 09:43 -0500, Kevin Crow - StataCorp wrote:

> I am not able to reproduce the bug here, but it does look like a bug
> because you where able to query the database using the -iodbc- client
> and get the correct results from the  PostgreSQL driver.  Do you know
> what version of the PostgreSQL driver you are using?

I'm using odbc-postgresql 07.03.0200-5 on a Debian AMD64 system.  This
driver has a slightly chequered history on AMD64 (see my Debian bug
report at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=318865 , but
it wasn't until I found that dates from MySQL imported OK that I
suspected it to be to blame for this one too!  

I am going to try building a recent odbc-postgresql,
psqlodbc-08.00.0102, but the dependencies for that are more recent
versions of ODBC libraries etc., which makes it non-trivial.

I will try this, because it would be good (if possible) to put this bug
down to a bug in odbc-postgresql rather than Stata.

> > So, at the 'describe' stage, Stata is perfectly aware of the correct
> > data
> >types for each field.
> 
> Also, when you use the -odbc exec- command Stata is simply displaying
> information giving to it as a string by the odbc driver.  Stata is not
> "aware" of the time/date data types of PostgreSQL.

Well, I disagree slightly: when you -odbc load-, the format given to the
date variable is %td, which at least infers that Stata believes it to be
a date!

I will post back my findings relating to the odbc-postgresql driver, if
only to feed the archives ... :-)

Cheers,

Dave.
- -- 
Dave Ewart
davee@ceu.ox.ac.uk
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFDOrLqbpQs/WlN43ARAlz1AJ0fDUHERj6wvx63dXpAZuviJfYcRwCePUAa
VgSF333g3Af+vJjow9Tb6YE=
=yo+m
-----END PGP SIGNATURE-----
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index