logo       

Re: Retrieving timestamp data: msg#00023

Subject: Re: Retrieving timestamp data
--- Michael Fuhr <mike@xxxxxxxx> wrote:

  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.

But you should only need to do this if you need
query results in
binary format.  Do you?

Actually, what I really needed is a timestamp data in either time_t or
struct tm format so that my application could easily manipulate the
data. If the data recieved is in string format, it would be a hassle
to manually parse the string just to convert it to struct tm.
Moreover, I'm not so sure but, if nls is supported, the query to
timestamp data might return the string formatted in another language
which would add more complications to parsing.

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?


When I tried getting the results in binary format, I get some value
which I have no idea how to parse, however, PostgreSQL has functions
(timestamp_recv) for converting timestamp data to struct pg_tm (which
I need) somewhere in timestamp.c/.h and it uses j2date which is
located in datetime.c/.h (both are located at \src\utils\). The
problem with using these is that they are (probably) part of the
backend. Could libpq be manipulated so that it includes those
functions (it could probably share that same code that that it's
synched with the backend format)?

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

               http://www.postgresql.org/about/donate



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe