X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A7D1ED8FC5 for ; Thu, 10 Nov 2005 15:59:00 -0400 (AST) 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 55879-09 for ; Thu, 10 Nov 2005 19:58:57 +0000 (GMT) X-Greylist: delayed 00:30:06.357318 by SQLgrey- Received: from sagit-server.com (sagit-server.com [193.95.229.214]) by svr1.postgresql.org (Postfix) with SMTP id 9935BD70C0 for ; Thu, 10 Nov 2005 15:58:57 -0400 (AST) Received: from Spooler by sagit-server.com (Mercury/32 v4.01a) ID MO001215; 10 Nov 2005 20:58:59 +0100 Received: from spooler by sagit-server.com (Mercury/32 v4.01a); 10 Nov 2005 20:28:39 +0100 Received: from Tadejnotebook (213.172.241.205) by sagit-server.com (Mercury/32 v4.01a) with ESMTP ID MG001213; 10 Nov 2005 20:28:29 +0100 From: "Tadej Kanizar" To: Subject: Re: time Date: Thu, 10 Nov 2005 20:29:07 +0100 Message-ID: <003601c5e62d$06b09600$680aa8c0@Tadejnotebook> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcXmK1tRTs/DoA4/RjWC72QVdulJzQAAVyBQ In-Reply-To: <11040.1131650023@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.714 required=5 tests=[RCVD_IN_NJABL_DUL=1.713, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 1.714 X-Spam-Level: * X-Archive-Number: 200511/97 X-Sequence-Number: 23348 So I don't open a new thread.. I have a table with a column of type TIMESTAMP. In output, I need to format it.. what's the best way to do it? So, for instance, how could I format it so that it would output as YY-MM-DD HH:MM? Regards, Tadej -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Tom Lane Sent: 10. november 2005 20:14 To: Michael Fuhr Cc: Rod Taylor; Judith Altamirano Figueroa; pgsql-sql@postgresql.org Subject: Re: [SQL] time Michael Fuhr writes: > Am I missing something? Is there a reason not to simply cast the > timestamp value to time? > test=> select now()::time; > now > ----------------- > 11:19:19.892125 > (1 row) > test=> select cast(now() as time); > now > ----------------- > 11:19:19.892125 > (1 row) I think the OP was trying to use the functional cast syntax time(now()) which worked long ago, but has not since we added the SQL-spec time precision syntax. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org