X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 60E77D7777 for ; Thu, 25 Aug 2005 18:52:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05728-05 for ; Thu, 25 Aug 2005 21:52:45 +0000 (GMT) Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id 25761D7682 for ; Thu, 25 Aug 2005 18:52:44 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 1E8PeO-0007Z1-00; Fri, 26 Aug 2005 07:52:44 +1000 Date: Thu, 25 Aug 2005 23:52:44 +0200 From: Martijn van Oosterhout To: "Matt A." Cc: pgsql-general@postgresql.org Subject: Re: help Message-ID: <20050825215244.GD17679@svana.org> Reply-To: Martijn van Oosterhout Mail-Followup-To: "Matt A." , pgsql-general@postgresql.org References: <20050825204453.89783.qmail@web35202.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d9ADC0YsG2v16Js0" Content-Disposition: inline In-Reply-To: <20050825204453.89783.qmail@web35202.mail.mud.yahoo.com> User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 required=5 tests=[AWL=0.003] X-Spam-Level: X-Archive-Number: 200508/1305 X-Sequence-Number: 82713 --d9ADC0YsG2v16Js0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Very odd, what are you trying? kleptog=3D# select nullif('','') is null; ?column?=20 ---------- t (1 row) kleptog=3D# select nullif('1','') is null; ?column?=20 ---------- f (1 row) Works for me. Have a nice day, On Thu, Aug 25, 2005 at 01:44:52PM -0700, Matt A. wrote: > We used nullif('$value','') on inserts in mssql. We > moved to postgres but the nullif() function doesn't > match empty strings to each other to return null. >=20 > MS SQL2000 nullif('1','') would insert 1 as integer > even though wrapped in '' (aka string). Also > nullif('','') would evaluate NULL (both equal returns > NULL) and insert the "not a value" accordingly, not > return text 'NULL' instead of return NULL if '' =3D=3D ''. > Postgresql will through an error since the defined > return type is text.=20 >=20 > I would like to alter this function all together. How > could I find it to manipulate it? >=20 > We cannot always enter a value for a integer, text, > boolean, etc column.=20 >=20 > Is there any other way to accomplish this in any > language? C? Python? PL/x? If so can you suggest where > we could learn how to do this or provide an example?=20 >=20 > Please help. >=20 > Domo > Matthew >=20 >=20 > =09 > ____________________________________________________ > Start your day with Yahoo! - make it your home page=20 > http://www.yahoo.com/r/hs=20 > =20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend --=20 Martijn van Oosterhout http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. --d9ADC0YsG2v16Js0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFDDj2rIB7bNG8LQkwRAhnqAKCJg3cbufpkpVrhG9USYxLxlKFZnwCfUaKu LJfJTZoEHufE6cswXjU/Zn0= =j82v -----END PGP SIGNATURE----- --d9ADC0YsG2v16Js0--