BUG #2037: user function call unexpected "input out of range"
От | Tom |
---|---|
Тема | BUG #2037: user function call unexpected "input out of range" |
Дата | |
Msg-id | 20051111212647.381D3F0CD9@svr2.postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #2037: user function call unexpected "input out of range"
Re: BUG #2037: user function call unexpected "input out of range" Re: BUG #2037: user function call unexpected "input out of range" Re: BUG #2037: user function call unexpected "input out of range" |
Список | pgsql-bugs |
The following bug has been logged online: Bug reference: 2037 Logged by: Tom Email address: lackey@ltu.edu PostgreSQL version: 8.1-beta4 Operating system: Windows XP Description: user function call unexpected "input out of range" Details: --No database needs to be selected. --Just cut and paste into a file. --All remarks are in comments. -- --From the psql prompt use "\i fileName". -- create function find (numeric,numeric,numeric,numeric) returns double precision as $$ --Calculate distance select acos ( sin($1*pi()/180)*sin($3*pi()/180) + cos($1*pi()/180)*cos($3*pi()/180) *cos(($2-$4)*pi()/180) )*60*1.1515*180/pi(); $$ language SQL; --Number 1. select find(42.3202,-83.2687,42.3202,-83.2687); --Number 2. select find(42.320,-83.2687,42.3202,-83.2687); --Number 3. select find(42.3338,-83.1818,42.3338,-83.1818); \df+ find; drop function find(numeric,numeric,numeric,numeric); /* This surfaced when calculating the distances between zip codes using latidtudes and longitudes. When the latitudes and longitudes are the same the distance should be zero. Number 1 gives the error. Number 2 differs by a digit in the last decimal place and works. Number 3 is another test with identical latitudes and longitudes and does calculate zero. The "DROP FUNCTION" was only put in so I could repeatly re-execute the script. The ".msi" was used for the install accepting all of the defaults. Thanks, Tom */
В списке pgsql-bugs по дате отправления: