Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id C6C01476590 for ; Thu, 30 May 2002 19:45:23 -0400 (EDT) Received: from lerlaptop (ppp31-7.ght.iadfw.net [207.136.52.135]) by postgresql.org (Postfix) with ESMTP id 66E9E4764AF for ; Thu, 30 May 2002 19:43:20 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by lerlaptop (8.12.3/8.12.3) with ESMTP id g4UNgqaW002753; Thu, 30 May 2002 18:42:53 -0500 (CDT) (envelope-from ler@lerctr.org) Subject: Re: Math Huh? From: Larry Rosenman To: josh@agliodbs.com Cc: pgsql-sql@postgresql.org In-Reply-To: <200205301629.26161.josh@agliodbs.com> References: <200205301629.26161.josh@agliodbs.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 30 May 2002 18:42:52 -0500 Message-Id: <1022802174.2593.3.camel@lerlaptop> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Archive-Number: 200205/320 X-Sequence-Number: 7955 On Thu, 2002-05-30 at 18:29, Josh Berkus wrote: > Folks, > > I'll let this session speak for itself: > > jwnet=> select version(); > version > --------------------------------------------------------------- > PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.95.3 > (1 row) > > jwnet=> select (255 * 255 * 255 * 255); > ?column? > ----------- > -66716671 > (1 row) > > So, a bug, or what? > You exceeded a SIGNED int4.. ler=# select (255*255*255*255) ler-# ; ?column? ----------- -66716671 (1 row) ler=# select (255::int8*255::int8*255::int8*255::int8); ?column? ------------ 4228250625 (1 row) ler=# select version(); version --------------------------------------------------------------------- PostgreSQL 7.2.1 on i386-portbld-freebsd4.6, compiled by GCC 2.95.3 (1 row) ler=# > > -- > -Josh Berkus > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749