Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 28BB09FB1BA for ; Fri, 2 Feb 2007 09:12:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 68875-08 for ; Fri, 2 Feb 2007 09:12:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 010DE9FA6B5 for ; Fri, 2 Feb 2007 09:12:31 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 1E70D74452; Fri, 2 Feb 2007 13:12:30 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id E1528274053; Fri, 2 Feb 2007 13:12:29 +0000 (GMT) Message-ID: <45C338BD.8000406@archonet.com> Date: Fri, 02 Feb 2007 13:12:29 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: Ezequias Rodrigues da Rocha Cc: pgsql-sql@postgresql.org Subject: Re: Insert into a date field References: <55c095e90702020508o70a561ffl8306739f311b8807@mail.gmail.com> In-Reply-To: <55c095e90702020508o70a561ffl8306739f311b8807@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/8 X-Sequence-Number: 27342 Ezequias Rodrigues da Rocha wrote: > Hi list, > > I am trying to insert a record in a table with a date field but the > postgresql reports me the following error: > > ERROR: column "data_nascimento" is of type date but expression is of type > integer > SQL state: 42804 > Hint: You will need to rewrite or cast the expression. > > > I tryed like this: > > > '1963-09-01' > '1963-09-01'::date > 1963-09-01 Show us the whole statement - this doesn't look like the error to me. -- Richard Huxton Archonet Ltd