Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D730E9FB1BA for ; Fri, 2 Feb 2007 09:50:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 16747-09 for ; Fri, 2 Feb 2007 09:49:39 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id D5FB49FA6B5 for ; Fri, 2 Feb 2007 09:49:43 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so680066ugf for ; Fri, 02 Feb 2007 05:49:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=IEPDX1ueH2Nct1sxgE7HQWsFiv1nIqhgpjVCJjSuLgye2YD+2TsORRjpNjbpfd/mAyImR4pXPJADDUok3zixJZKF2V53bWToQmGlNxk2+RYCxFn9puTPCkyyNJAxZdoNqeP7omCeGeQT/tNJeQNLxaXS0ItcF6+gGn9oerzgJCE= Received: by 10.66.232.9 with SMTP id e9mr4448793ugh.1170424181967; Fri, 02 Feb 2007 05:49:41 -0800 (PST) Received: by 10.66.217.13 with HTTP; Fri, 2 Feb 2007 05:49:41 -0800 (PST) Message-ID: <55c095e90702020549rc19501boa5d4ac4a18d9dc0c@mail.gmail.com> Date: Fri, 2 Feb 2007 11:49:41 -0200 From: "Ezequias Rodrigues da Rocha" To: "Shoaib Mir" Subject: Re: Insert into a date field Cc: "Richard Huxton" , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20658_17260079.1170424181690" References: <55c095e90702020508o70a561ffl8306739f311b8807@mail.gmail.com> <45C338BD.8000406@archonet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/11 X-Sequence-Number: 27345 ------=_Part_20658_17260079.1170424181690 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Now it's ok thank you. 2007/2/2, Shoaib Mir : > > Just tried the following way, that might help you: > > postgres=3D# create table testing (a date); > CREATE TABLE > postgres=3D# insert into testing values (to_date('1963-09-01', > 'YYYY-MM-DD')); > INSERT 0 1 > postgres=3D# select * from testing; > a > ------------ > 1963-09-01 > (1 row) > > -- > Shoaib Mir > EnterpriseDB (www.enterprisedb.com) > > On 2/2/07, Richard Huxton wrote: > > > 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 > > > > ---------------------------(end of broadcast)--------------------------= - > > > > TIP 4: Have you searched our list archives? > > > > http://archives.postgresql.org > > > > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- A pior das democracias ainda =E9 melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ------=_Part_20658_17260079.1170424181690 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Now it's ok thank you.

2007/2/2= , Shoaib Mir <shoaibmir@gmail.com= >:
Just tried the following way, that might help you:

postgres=3D# crea= te table testing (a date);
CREATE TABLE
postgres=3D# insert into test= ing values (to_date('1963-09-01', 'YYYY-MM-DD'));
INSERT= 0 1
postgres=3D# select * from testing;
     a
--= ----------
 1963-09-01
(1 row)

--
Shoaib Mir
Enterp= riseDB ( www.enterprisedb.com)

On 2/2/07, Richard Huxton <dev@archonet.com> wrote:
Ezequias Rodrigues da Rocha wrote:
> Hi list,
>
> I am tr= ying to insert a record in a table with a date field but the
> postgr= esql reports me the following error:
>
> ERROR: column "da= ta_nascimento" is of type date but expression is of type
> integer
> SQL state: 42804
> Hint: You will need to re= write or cast the expression.
>
>
> I tryed like this:>
>
> '1963-09-01'
> '1963-09-01'::da= te
> 1963-09-01

Show us the whole statement - this doesn't l= ook like the error to me.

--
   Richard Huxton
 = ;  Archonet Ltd

---------------------------(end of= broadcast)---------------------------
TIP 4: Have you searched our list archives?

   &n= bsp;           http://archives.postgresql.org




--
=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
      = ;            &n= bsp;            = ;   Atenciosamente (Sincerely)
    &n= bsp;            = ;       Ezequias Rodrigues da Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -
A pior das democracias ainda =E9 melhor do que a melhor das ditaduras<= br>The worst of democracies is still better than the better of dictatorship= s
http://ezequiasrocha.blo= gspot.com/ ------=_Part_20658_17260079.1170424181690--