ecpg - timestamp - howto

Поиск
Список
Период
Сортировка
От tövis
Тема ecpg - timestamp - howto
Дата
Msg-id 002c01c5d0e3$002fbf90$3401a8c0@mainxp
обсуждение исходный текст
Список pgsql-novice
Hi!
Has some one used timestamps through ecpg in a simple C program?
How to declare, an acceptor variable to convert timestamp (w/o timezone) to a simple time_t or timeval value?
 
I'm using PostgreSQL 7.4.7(-6sarge1) on Debian 3.1 stable, client is also a Debian 3.1 workstation.
 
I have tried include "pgtypes_timestamp.h"
 
exec sql BEGIN DECLARE SECTION;
...
timestamp   TBL_dtm;
...
exec sql AND DECLARE SECTION;
 
 
 
int somefunc()
{
  time_t   stamp;
...
exec sql FETCH NEXT TBL_cursor
             INTO :TBL_dtm ...
 
...
   stamp = TBL_dtm;
 
}
 
All other values drawn by SELECT through cursor are good but timestamp to time_t gives ZERO (1970.01.01 01:00:00:00);o(
Of course I can write my own conversion routine for string of timestamp but I now it should be ready to use in ecpg libraries!
 
Thanks in advance
    Tovis
 
 
 

В списке pgsql-novice по дате отправления:

Предыдущее
От: Cath Lawrence
Дата:
Сообщение: Re: pg_hba.conf and ssl problem has me stumped
Следующее
От: "krishnaa sridharan"
Дата:
Сообщение: psql command line