Re: numeric cast oddity - Mailing list pgsql-general

From Sim Zacks
Subject Re: numeric cast oddity
Date
Msg-id 4B17DF68.2020508@compulab.co.il
Whole thread Raw
In response to Re: numeric cast oddity  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
It is more then just a
headers issue. I have a view that has a column of type numeric(20,4).
I modified the view and
added a union which cast an integer as a numeric(20,4) using the ::
notation.
I received an error
stating that I could not change the column type.
When I used the cast
function notation it allowed it through.


The fact that it
actually converts it to numeric(20,4) doesn't help me if the view
thinks that it is a regular numeric.


Sim





Scott Marlowe wrote:

<blockquote
 cite="mid:dcc563d10912030749r2bc35040qd42da5b29c37193f@mail.gmail.com"
 type="cite">
  On Thu, Dec 3, 2009 at 8:03 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:


    Sim Zacks <sim@compulab.co.il> writes:


      When I cast an integer to numeric using :: notation it ignores the scale
and precision that I specify, but when I use the cast function it uses
the scale and precision that I specify.


    Really?  Your example doesn't seem to show that.



I think he's talking about the headers

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [Bacula-users] Catastrophic changes to PostgreSQL 8.4
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: [Bacula-users] Catastrophic changes to PostgreSQL 8.4