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


Groups > comp.databases.postgresql > #199

Re: "explicit type casts" ?

From Mladen Gogala <gogala.mladen@gmail.com>
Newsgroups comp.databases.postgresql
Subject Re: "explicit type casts" ?
Date 2011-08-08 12:03 +0000
Organization solani.org
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>

Show all headers | 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