X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 33B98D8A75 for ; Thu, 8 Sep 2005 16:45:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07649-03 for ; Thu, 8 Sep 2005 19:45:05 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 55612D8A56 for ; Thu, 8 Sep 2005 16:45:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j88Jj6QG024866; Thu, 8 Sep 2005 15:45:06 -0400 (EDT) To: Norman Yamada Cc: pgsql-interfaces@postgresql.org, Yasser El-Zein Subject: Re: getting julian number from date in libpq In-reply-to: <7D1583CD-3DEC-4F01-BF07-6599B7AEF38B@millburncorp.com> References: <7D1583CD-3DEC-4F01-BF07-6599B7AEF38B@millburncorp.com> Comments: In-reply-to Norman Yamada message dated "Thu, 08 Sep 2005 14:12:33 -0400" Date: Thu, 08 Sep 2005 15:45:06 -0400 Message-ID: <24865.1126208706@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/6 X-Sequence-Number: 5729 Norman Yamada writes: > Postgresql stores dates as Julian days, but using libpq, I don't see > how to get out a date quickly as a julian day. If I use PQgetvalue, > my date is automagically converted into whatever my DATESTYLE is at > the time. How can I just get out the internal julian date? Something involving EXTRACT(EPOCH FROM timestamp) will probably solve your problem. regards, tom lane