Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mladen Gogala Newsgroups: comp.databases.postgresql Subject: Re: "explicit type casts" ? Date: Mon, 8 Aug 2011 12:03:49 +0000 (UTC) Organization: solani.org Lines: 16 Message-ID: References: <4e3d9c85$0$313$14726298@news.sunsite.dk> <4e3fa8a8$0$309$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: solani.org 1312805029 30083 eJwVyskRwDAIA8CWLA7hlEOI1X8Jnux70wlOBZORSnU5zIcjFXebjUwARgvWcdZ+LHjyRf75uxhGEPI= (8 Aug 2011 12:03:49 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 8 Aug 2011 12:03:49 +0000 (UTC) User-Agent: Pan/0.133 (House of Butterflies) X-User-ID: eJwNx9sBADEEBMCWCBblJB79l3A3f2MCRrnCoLa2OSrJSo1r6R1RWlzbfulP4vk0+6mnK3OCPhe7ERY= Cancel-Lock: sha1:rfCP3nqiKXUmO8omt8grOMjlHx8= X-NNTP-Posting-Host: eJwNyMEBwEAEBMCWcCwpR7jtv4RknhMHiklHwIPB9IQxe+8ppfeTQCsTslPLA+pbaUAV/V0R5F/m7KgtHGPfGVXbOxUyH8HgGd0= Xref: x330-a1.tempe.blueboxinc.net comp.databases.postgresql:199 On Mon, 08 Aug 2011 11:13:12 +0200, Bjarne Jensen wrote: > So thats how it is used! Thanks a lot. > > / Bjarne This actually rather sloppy coding practice. If the column cannot be converted to integer, the query will fail. I would advise enveloping the cast in your own function which would return something expected, instead of throwing an error. -- http://mgogala.byethost5.com