INTERVAL data type and libpq - what format? - Mailing list pgsql-hackers

From Sebastien FLAESCH
Subject INTERVAL data type and libpq - what format?
Date
Msg-id 4A1182CC.80209@4js.com
Whole thread Raw
Responses Re: INTERVAL data type and libpq - what format?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Hello,

I try to use the new 8.4 INTERVAL type with libpq, but get crazy with
the input formatting rules...

I use PQprepare() / PQexecPrepared() with parameter list, binding the
INTERVAL values with the 1186 pg_type (is this ok?) and passing a
string buffer with values like:

"12345"   for an INTERVAL YEAR

The INSERT works without error, but when selecting rows from the table
in psql, I get "00:00:00" values ?!?!

When inserting the value "12345" from the psql command tool it works...

I must be doing something wrong, but I could not find any documentation
on using INTERVAL in libpq...

Can someone from the hackers just tell me if it's supposed to work and
if yes what format is expected by the client library?

Thanks a lot!
Seb


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Compiler warning
Next
From: Merlin Moncure
Date:
Subject: Re: INTERVAL data type and libpq - what format?