Re: POWER vs. POW ??? - Mailing list pgsql-hackers

From Reinoud van Leeuwen
Subject Re: POWER vs. POW ???
Date
Msg-id 20051124120600.GS67050@spoetnik.xs4all.nl
Whole thread Raw
In response to POWER vs. POW ???  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
On Thu, Nov 24, 2005 at 08:00:21PM +0800, Christopher Kings-Lynne wrote:
> How come these give slightly different results?
> 
> test=# SELECT POW(2,-2);
>  pow
> ------
>  0.25
> (1 row)
> 
> test=# SELECT POWER(2,-2);
>  power
> -------
>   0.25
> (1 row)
> 
> 
> (Note width of result field.)

The result field is the length of min(the string, printable result) + 2:

# SELECT POW(2,-2);pow
------0.25
(1 row)

# SELECT POW(2,-2) as power;power
------- 0.25
(1 row)

# SELECT POW(2,-2) as p; p
------0.25
(1 row)

-- 
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen    reinoud.v@n.leeuwen.net
http://www.xs4all.nl/~reinoud
__________________________________________________


pgsql-hackers by date:

Previous
From: Harald Armin Massa
Date:
Subject: Re: [GENERAL] Private email requests
Next
From: "Pavel Stehule"
Date:
Subject: Re: NVL vs COALESCE