Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 26155475D01 for ; Thu, 22 Aug 2002 10:28:48 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id AEAFD475CBF for ; Thu, 22 Aug 2002 10:28:47 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 389C7D609; Thu, 22 Aug 2002 07:28:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2E4645C05; Thu, 22 Aug 2002 07:28:48 -0700 (PDT) Date: Thu, 22 Aug 2002 07:28:48 -0700 (PDT) From: Stephan Szabo To: Lucas Brasilino Cc: Subject: Re: Problem with timestamp field/time function.. (upgrading In-Reply-To: <3D64CEFF.1090609@recife.pe.gov.br> Message-ID: <20020822072508.V6679-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/312 X-Sequence-Number: 9158 On Thu, 22 Aug 2002, Lucas Brasilino wrote: > Hi Stephan > > >> So, how can I get the same result above without using time() ?? > >>Or if it not possible, how can I extract (yes, I tried with extract() > >>function too) time from a timestamp column? > >> I know it's quite simple question... but I haven't find any clue! > >> > > > > In general you could probably use CAST(materiadata as time) I'd guess. > > I believe that at this point you can still use the functions, you just > > need to double quote them ("time"(materiadata)) to differentiate them > > from the type specifiers. > > > > Well, it seems to work only with "timestamp without time zone" type. But > worked. Thanks a lot. > For me it's a new approching not using functions such as time, but > "casting" it to a "time" type ( like select materiadata::time from > materia;). > If PostgreSQL development group change it's point of view, I suppose > there's some advantage. Do you know some advantages ?? time(n) and timestamp(n) refer to a type which I believe gives n digits of fractional seconds in SQL. Compatibility for that SQL feature was added but the syntax collided with the old usage. In any case the old time() etc were actually typecasts since it was a direct call to the type casting function.