to_number function questions

From: Cindy <ctmoore(at)uci(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: to_number function questions
Date: 2002-09-17 19:26:57
Message-ID: 7569.1032290817@attalus2.tlg.uci.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


What does to_number do with a string like "123x78" ? Does
it try to convert the whole string? Does it stop at x, giving 123?
Does it drop x? Does it return some sort of failure?

Also, suppose that you give to_number 123, and the second parameter is
"999999" ? Do the extra 9's give any problem (you dn't always know
whether to_number will get 0-99999, so what do you give it in the
formatting string? If it has more 9's in the format string than are
digits in the number, will it pad it?

Sorry for all the q's but the page
http://www.postgresql.org/idocs/index.php?functions-formatting.html
only lists things in tables and does not discuss the sorts of questions
or oddball inputs/exceptions I ask about.

Thanks,
--Cindy
--
ctmoore(at)uci(dot)edu

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2002-09-17 19:55:59 Re: general trouble installing languages
Previous Message Cindy 2002-09-17 18:58:51 Re: general trouble installing languages