Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BEDF3475F28 for ; Thu, 5 Dec 2002 05:29:59 -0500 (EST) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by postgresql.org (Postfix) with ESMTP id 18472475EAE for ; Thu, 5 Dec 2002 05:29:59 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 18JtGa-0006uR-0X; Thu, 05 Dec 2002 10:30:00 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 448E917252; Thu, 5 Dec 2002 10:29:59 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 9F85717235; Thu, 5 Dec 2002 10:29:58 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: kanika singh , pgsql-sql@postgresql.org Subject: Re: Regarding boolean datatype Date: Thu, 5 Dec 2002 10:29:59 +0000 User-Agent: KMail/1.4.3 References: <20021205091110.58690.qmail@web14512.mail.yahoo.com> In-Reply-To: <20021205091110.58690.qmail@web14512.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200212051029.59648.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/66 X-Sequence-Number: 10654 On Thursday 05 Dec 2002 9:11 am, kanika singh wrote: > Hello all, > > this is my first interaction with this list. I have a > problem. I was using MSSQL Server as db, now i m > changing to Postgres. I know that the bit type in > MSSQLserver is boolean in Postgres. There's also a bit type if that's really what you want, but in this case I= =20 think boolean is right. PS - if you get error messages again, please let us know what version and= =20 client you are using (e.g. PostgreSQL v7.2.1 from jdbc) > strSql =3D " Update parts Set name =3D ? , description =3D ? > world_market =3D ?, part =3D ? , unit_of_measure =3D ? > Where depot=3D ?; > > prepStmt =3D conn.prepareStatement(strSql); > prepStmt.setString( 1, Pname) ; > prepStmt.setString( 2, Pdesc) ; > prepStmt.setBoolean(3, BoolWM) ; [snip] > SQLError ERROR: Unable to identify an operator '~~' > for types 'boolean' and 'unknown' > You will have to retype this query using an explicit > cast Are you sure this error goes with this query? I don't see any use of LIKE h= ere=20 (which is what ~~ does for you). > I know, somewhere i m making mistake, but where?? > Moreover, if i m updating the database with the above > query, the db is giving the error and deleting the > data from the db. As per my understanding it should > automatically rollback. What is the problem??? I find this unlikely. If Postgresql was in the habit of deleting data witho= ut=20 being asked to there'd be mention of it. I suggest you turn query logging o= n=20 (in your postgresql.conf file) while you try to reproduce this. That will= =20 show you what is really happening. > What are the other coding rules for Postgres?? Manuals are at http://www.postgresql.org/ Extra info at http://techdocs.postgresql.org/ (including some online books) Mailing lists you know about. --=20 Richard Huxton