X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 78181D1DA59 for ; Sun, 23 Nov 2003 16:21:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 32312-07 for ; Sun, 23 Nov 2003 12:20:57 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id EB849D1D9F3 for ; Sun, 23 Nov 2003 12:20:56 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hANGKuNu032397 for ; Sun, 23 Nov 2003 16:20:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hANGIlGS031858 for pgsql-sql@postgresql.org; Sun, 23 Nov 2003 16:18:47 GMT From: "nobody" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: How to quote date value? Date: Sun, 23 Nov 2003 16:18:40 -0000 Organization: Hub.Org Networking Services Lines: 34 Message-ID: References: <3FBE52FC.3060503@bigfoot.com> <20031121110022.U75942@megazone.bigpanda.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/315 X-Sequence-Number: 16130 Thanks, I learnt to use: SELECT CAST('1/11/2003' AS DATE) AS invoice_number; and it does what I would expect ;-). "Stephan Szabo" wrote in message news:20031121110022.U75942@megazone.bigpanda.com... > > On Fri, 21 Nov 2003, Gaetano Mendola wrote: > > > nobody wrote: > > > I have found it in documentation, it is single quote. But it does not > > > explain why > > > > > > SELECT '1/11/2003' AS "InvoiceDate"; > > > > > > returns "unknown" data type instead of "date". > > (I haven't seen the original message yet, so I'm replying to a reply) > Date literals are generally written as: > DATE '1/11/2003' > > PostgreSQL will try to guess what type you meant with quoted strings in > expressions, but in the above there isn't enough context to do guess that > you meant a date really (it should probably actually be thought of as a > string in such cases). > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >