Thread: Another date/time question using libpq

Another date/time question using libpq

From
Thuffman00@aol.com
Date:
Using a stored procedure (function in Postgres), I insert data which contains a column called "creation_dt". Here I insert that date/time the row was created. With psql I can view and confirm the data with a select statement. My problem is retrieving the columns infornation from the result using PQgetvalue. More specificly, how/what data type to use. PQgetvalue returns a char * and I'm unfamilar with how to or what to cast this as that will return the result I need. If someone could demonstrate what data type to return/cast from the PQgetvalue and how to format that inot a date format I would be very appreciative.  Here's the function and insert statement I'm using:
 
.
.
.
BEGIN
v_creation_date := CURRENT_TIMESTAMP;
 
insert into mytable (creation_dt) values v_creation_date;
 
END;
 
TIA
Tom
 
BTW I'm not subscribed.