Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #199

Re: "explicit type casts" ?

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 <gogala.mladen@gmail.com>
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 <pan.2011.08.08.12.03.49@gmail.com> (permalink)
References <4e3d9c85$0$313$14726298@news.sunsite.dk> <pan.2011.08.07.17.37.43@gmail.com> <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

Show key headers only | View raw


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

Back to comp.databases.postgresql | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

"explicit type casts" ? Bjarne Jensen <bjarne.b.jensen@gmail.com> - 2011-08-06 21:56 +0200
  Re: "explicit type casts" ? Robert Klemme <shortcutter@googlemail.com> - 2011-08-07 13:06 +0200
    Re: "explicit type casts" ? Bjarne Jensen <bjarne.b.jensen@gmail.com> - 2011-08-07 18:44 +0200
  Re: "explicit type casts" ? Mladen Gogala <gogala.mladen@gmail.com> - 2011-08-07 17:37 +0000
    Re: "explicit type casts" ? Bjarne Jensen <bjarne.b.jensen@gmail.com> - 2011-08-08 11:13 +0200
      Re: "explicit type casts" ? Mladen Gogala <gogala.mladen@gmail.com> - 2011-08-08 12:03 +0000

csiph-web