Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 277C8632B7F for ; Wed, 11 Mar 2009 03:15:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 73947-08 for ; Wed, 11 Mar 2009 03:15:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f176.google.com (mail-gx0-f176.google.com [209.85.217.176]) by mail.postgresql.org (Postfix) with ESMTP id 307666325A9 for ; Wed, 11 Mar 2009 03:15:15 -0300 (ADT) Received: by gxk24 with SMTP id 24so5483304gxk.19 for ; Tue, 10 Mar 2009 23:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=YXQ3gq+QVhGoHXoSEvTAOXE+rpAx2f5r+Yxt/92tBh8=; b=wACMhZxctoqsGyIMZ92QpsJPz3izU49MqN32q24lRtzwTEA5P2xVjGu382LjfUVRSN cMRq5AFR8l5mVyHhDHJQOMUDypP7tcZ1HwPujVyiyGM4wq/oGUqLiuJxsdkEa6Oond59 4waxtyXY2L57NI9N+gXBQ6wst+C7V4ITmB26U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=nKFvmlMngGAHo+9uKhENoA0kQcG9cqURCvgiYd3joDNd0u+YpRWZNnAZTJvixYFPgf gVJHrk+FgC4WZ2PC4sTGI7CeNFjSPnZuzlZAtKJSwgFMmoRHXMdouHGEEOM0+ManINhi s06RVHyy61vFBWtX7hkjmm+Kbo6+J1yoVVM6w= MIME-Version: 1.0 Received: by 10.151.42.10 with SMTP id u10mr4566527ybj.3.1236752114322; Tue, 10 Mar 2009 23:15:14 -0700 (PDT) In-Reply-To: References: Date: Wed, 11 Mar 2009 00:15:14 -0600 Message-ID: Subject: Re: any way to convert date via libpq? From: Scott Marlowe To: Tena Sakai Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/144 X-Sequence-Number: 31644 On Wed, Mar 11, 2009 at 12:07 AM, Tena Sakai wrote: > Hi Scott, > > Many thanks for your reply. > I just tried: > =A0 select extract (epoch from timestamp with time zone '2008-04-04 > 20:00:0.0'); > and got: > =A0 1207364400 > which is great! > > I suppose there is no problem running this query > via PGexec() in a C program?=A0 Something like: > =A0 result =3D PGexec (conn, "FETCH ALL from somePort"); It's definitely accessable by anything connecting to the db. Not sure how that's done in C so someone else will have to chip in on that.