Another date/time question using libpq - Mailing list pgsql-novice

From Thuffman00@aol.com
Subject Another date/time question using libpq
Date
Msg-id 195.2d5b0256.2e534d15@aol.com
Whole thread Raw
List pgsql-novice
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.

pgsql-novice by date:

Previous
From: michael@floog.net
Date:
Subject: DATE column doesn't like empty string or null value
Next
From: the inquirer
Date:
Subject: Authentication problems