From: Tomasz Myrta <jasiek@klaster.net>
To: creid <creid@netbcg.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: LIBPQ
Date: Mon, 27 Oct 2003 08:10:27 +0100
Message-ID: <3F9CC4E3.702@klaster.net> (raw)
In-Reply-To: <ILECJKPFOLBAGINIFFFBKEBGCAAA.creid@netbcg.com>
References: <ILECJKPFOLBAGINIFFFBKEBGCAAA.creid@netbcg.com>
Dnia 2003-10-23 22:01, Użytkownik creid napisał:
> Can anyone help me understand what it is I need to do to simply retrieve
> date and time columns into C variables that are readable. All other columns
> are come across successfully but the date and time. I have tried double to
> store the pg date and char[9] for time, among other typedef tries. My
> psotgres columns are defined as: mytime time, mydate date.
>
> Thanks
> C
1. char[9] is too short for displaying time. Default text representation
of time is:
08:06:05.474477
You can:
- use longer variable char[16]
- format your time to have 08:06:05 only using to_char(...)
- change your columns from "time" to "time(0)"
2. char[9] is also too short for date. Default text representation for
date (European format) is:
2003-10-27
You need char[11] for this.
Regards,
Tomasz Myrta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jasiek@klaster.net, creid@netbcg.com
Subject: Re: LIBPQ
In-Reply-To: <3F9CC4E3.702@klaster.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox