X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E07E252AB4 for ; Wed, 20 Jul 2005 17:52:59 -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 62715-04 for ; Wed, 20 Jul 2005 20:52:51 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by svr1.postgresql.org (Postfix) with ESMTP id 9C74252AAB for ; Wed, 20 Jul 2005 17:52:50 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id i21so1552554wra for ; Wed, 20 Jul 2005 13:52:52 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=YHW/P7bXBF1tUIlAy+4YHhwhCw1v72DmREl8oiL+1oO7S2HRSoQ1Hw8+DoeGkj8WFWQyZe9LKcohTGAiQni1j1oclokKOB69eqKYxhWUEEDnLmlSaDwZM+NWvH3yqcYuzIVcTRBpwuMYh+JBz0fTvtbbPnOhnZDsETdXRkspvIw= Received: by 10.54.73.15 with SMTP id v15mr250182wra; Wed, 20 Jul 2005 13:52:21 -0700 (PDT) Received: by 10.54.86.16 with HTTP; Wed, 20 Jul 2005 13:52:21 -0700 (PDT) Message-ID: <90876a9e05072013521b8d8e98@mail.gmail.com> Date: Wed, 20 Jul 2005 14:52:21 -0600 From: Christian Cryder Reply-To: Christian Cryder To: List Subject: Custom types in Postgres, JDBC Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.08 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/200 X-Sequence-Number: 13348 Here's a question. Let's say I wanted to create a custom datatype in Postrgres - something like a timezone2 which would persist the data as millis. Does anyone have any pointers on where one would start in thinking about this? I am pretty sure that I could implement something in our statement wrapper classes that would allow me to convert timestamps to millis values and then save them as bigints rather than timestamps. And I could probably create a couple of stored proc functions on the server for easily displaying such millis as timestamps, and querying against them via a timestamp string. So I guess what I am asking is - how would one actually do it at a lower level - defining a new type within postgres, and then having that mapped to a new custom type (which my wrapper classes could then convert to java.sql.Timestamps). I realize this is more than just a JDBC question, but JDBC certainly plays a role in it. Any thoughts on whether this is a good idea or a bad one? Any pointers? Cav= eats? Thanks, Christian