Binding time and timestamp with time zone data type

From: Mateusz Loskot <mateusz(at)loskot(dot)net>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Binding time and timestamp with time zone data type
Date: 2016-11-22 09:21:59
Message-ID: CABUeae8fYodDk0jt0NZ1tHChbmWPGj+DRYy2805X7dvppWNs7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

I'm using psqlODBC 9.05.03.00.

I have two questions regarding use of time and timestamp data types.

I noticed a quirk in mapping the PostgreSQL time data types to ODBC data types,
that is how they are reported by SQLDescribeCol:

1. 'time without time zone' and 'timestamp without time zone'
as SQL_TIME and SQL_TIMESTAMP respectively

2. 'timestamp with time zone' is reported as SQL_TIMESTAMP

3. 'time with time zone' is reported as SQL_[W]VARCHAR, not as SQL_TIME.

As far as my ODBC knowledge goes, the first two mappings are expected,
whereas the third seems odd.

Could anyone explain to me why is the 'time with time zone' is mapped like that?

Second, what is the correct way to bind and fetch data from column
of 'time with time zone' or 'timestamp with time zone' data types
in order to get the time zone component?

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

Browse pgsql-odbc by date

  From Date Subject
Next Message Branden Huggins 2016-11-23 22:40:33 Can't input username into sspi odbcconnection
Previous Message Germán Valdez 2016-11-20 19:49:10 Re: error conection Provider=MSDASQL