Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E21874760F0 for ; Tue, 20 Aug 2002 13:03:56 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id BE9664760E7 for ; Tue, 20 Aug 2002 13:03:55 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 0FE13D610; Tue, 20 Aug 2002 10:03:55 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 058D65C04; Tue, 20 Aug 2002 10:03:54 -0700 (PDT) Date: Tue, 20 Aug 2002 10:03:54 -0700 (PDT) From: Stephan Szabo To: Lucas Brasilino Cc: Subject: Re: Problem with timestamp field/time function.. (upgrading In-Reply-To: <3D627011.8000003@recife.pe.gov.br> Message-ID: <20020820100127.S43175-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/296 X-Sequence-Number: 9142 On Tue, 20 Aug 2002, Lucas Brasilino wrote: > I'm running postgresql 7.0 with a column like: > > Table "materia" > Column | Type | Modifiers > --------------------+--------------------------+----------- > > materiadata | timestamp with time zone | not null > mmateriatitulo | character varying(80) | not null > materiasequencial | numeric(30,6) | not null > > > I used to execute this query: > > select max(time(materiadata)) from materia; > > or > select materiasequencial, materiatitulo, time(materiadata) > from materia > order by time(materiadata) desc; > > I've read at PostgreSQL 7.3dev Administrator Guide's Release Notes that > time() and timestamp() functions in postgresql 7.2 are deprecated (so in > 7.2.1). > > 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.