From: | Tomasz Myrta <jasiek(at)klaster(dot)net> |
---|---|
To: | creid <creid(at)netbcg(dot)com> |
Cc: | pgsql-interfaces(at)postgresql(dot)org |
Subject: | Re: LIBPQ |
Date: | 2003-10-27 07:10:27 |
Message-ID: | 3F9CC4E3.702@klaster.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Tomasz Myrta | 2003-10-27 07:15:40 | Re: LIBPQ Question |
Previous Message | ljb | 2003-10-27 02:33:58 | pgtcl large object read/write corrupts binary data |