Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CF9319FB2C1 for ; Sun, 4 Mar 2007 13:24:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 85099-06 for ; Sun, 4 Mar 2007 13:24:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id A3ADA9FB2D4 for ; Sun, 4 Mar 2007 13:24:01 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l24HNu7o021532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 4 Mar 2007 10:23:59 -0700 (MST) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l24HNuqn039005; Sun, 4 Mar 2007 10:23:56 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l24HNt6K039004; Sun, 4 Mar 2007 10:23:55 -0700 (MST) (envelope-from mfuhr) Date: Sun, 4 Mar 2007 10:23:55 -0700 From: Michael Fuhr To: "::Willi the One::" Cc: pgsql-interfaces@postgresql.org Subject: Re: Retrieving timestamp data Message-ID: <20070304172355.GA38897@winnie.fuhr.org> References: <20070304152310.95205.qmail@web36709.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20070304152310.95205.qmail@web36709.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.058 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_PASS X-Spam-Level: X-Archive-Number: 200703/10 X-Sequence-Number: 6451 On Sun, Mar 04, 2007 at 07:23:10AM -0800, ::Willi the One:: wrote: > In the documentation, it says that PQgetvalue() > returns string values for strings and "the value is in > the binary representation determined by the data > type’s typsend and typreceive functions." You've omitted part of what the documentation says. The complete text is: For data in text format, the value returned by PQgetvalue is a null-terminated character string representation of the field value. For data in binary format, the value is in the binary representation determined by the data type's typsend and typreceive functions. > The problem is, where's the typsend and typrecieve located? In the backend. You can find out which functions they are by querying pg_type, and you can learn more about the functions themselves by querying pg_proc and by examining the source code. But you should only need to do this if you need query results in binary format. Do you? > For example, if I want to retrieve a timestamp data, > how would I do it? Will it return as a string when I > call PQgetvalue()? What about other types such Points > or inet types? Unless you request results in binary format all values will be returned as text strings. What happened when you tried it? Are you requesting results in binary format? -- Michael Fuhr