Re: Type casting bug in 8.1.[67]?

Lists: pgsql-hackers
From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Type casting bug in 8.1.[67]?
Date: 2007-02-06 11:34:50
Message-ID: 45C867DA.7060004@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello all,

after upgrading from 8.1.5 to 8.1.7, I got errors in the server log when
updating decimal values using string constants. I tried the same using
psql (pasted the query from below) and it fails, too. Downgrading to
8.1.5 resolved the issue.

ERROR: attribute 4 has wrong type
DETAIL: Table has type numeric, but query expects numeric.
STATEMENT: UPDATE reminder SET reminder_charges='0' WHERE reminder_id=29362

reminder_charges is defined as:
reminder_charges | numeric(5,2) | not null

I guess this is a bug.

Best Regards
Michael Paesold


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Type casting bug in 8.1.[67]?
Date: 2007-02-06 14:46:54
Message-ID: 20070206144654.GB27851@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Feb 06, 2007 at 12:34:50PM +0100, Michael Paesold wrote:
> Hello all,
>
> after upgrading from 8.1.5 to 8.1.7, I got errors in the server log when
> updating decimal values using string constants. I tried the same using
> psql (pasted the query from below) and it fails, too. Downgrading to
> 8.1.5 resolved the issue.

Someone on -general just posted exactly the same problem for 8.1.7. I
wonder if the recent security update broke something else?

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Type casting bug in 8.1.[67]?
Date: 2007-02-06 16:31:00
Message-ID: 12978.1170779460@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Michael Paesold <mpaesold(at)gmx(dot)at> writes:
> after upgrading from 8.1.5 to 8.1.7, I got errors in the server log when
> updating decimal values using string constants.

Have you got a constraint or functional index on that column?

regards, tom lane


From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Type casting bug in 8.1.[67]?
Date: 2007-02-06 19:04:42
Message-ID: 45C8D14A.90502@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Michael Paesold <mpaesold(at)gmx(dot)at> writes:
>> after upgrading from 8.1.5 to 8.1.7, I got errors in the server log when
>> updating decimal values using string constants.
>
> Have you got a constraint or functional index on that column?

Yes.

Check constraints:
"tc_reminder_charges" CHECK (reminder_charges >= 0::numeric)

As I read from your other post, you already figured that the issue is
related to check constraints (or functional indexes).

Best Regards,
Michael Paesold