X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 128C3D1B50A for ; Mon, 27 Oct 2003 07:10:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92905-03 for ; Mon, 27 Oct 2003 03:10:00 -0400 (AST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id A1CCAD1B4FB for ; Mon, 27 Oct 2003 03:09:57 -0400 (AST) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 01C142B3CB; Mon, 27 Oct 2003 08:09:52 +0100 (CET) Message-ID: <3F9CC4E3.702@klaster.net> Date: Mon, 27 Oct 2003 08:10:27 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5) Gecko/20030916 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: creid Cc: pgsql-interfaces@postgresql.org Subject: Re: LIBPQ References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/51 X-Sequence-Number: 4540 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