[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Interesting side-effect of upgrading to postgres 7.2.1
Quoting Andrew McBeath (andrew@zeald.com):
> After I upgraded postgres from 7.1.2 to 7.2.1, a rather interesting bug
> raised it's head - the checkout page randomly stopped working.
>
> It was logging the following errors:
>
> <ip,date, and other stuff> Route log failed.
> <ip,date, and other stuff> ERRORS on ORDER EDOS0000218:
>
> > Error during creation of order routing log:
> > Route log failed. at /usr/local/interchange/lib/Vend/Order.pm line
> 1574.
>
> I traced this to where the transaction is logged - lines 48-98 in
> etc/log_transaction:
>
> [import table=transactions type=LINE continue=NOTES]
> ...
> [/import]
>
> Postgres logs the following error:
>
> ERROR: value too long for type character varying(12)
>
> Specifically, it was failing when a inserted value was larger than the
> field size in the transactions table. On inspection, I found the old
> Postgres behaviour was to truncate any value too large for the field.
> Now it correctly (one might argue otherwise) spits the dummy.
>
> Yes, I know this is a Postgres and ic developer / data integrity issue,
> but thought it was worth a mention as I have now heard of other
> Postgres-based apps also crashing due to lack of data-integrity
> enforcement... :-)
If you want to enforce this with IC, you can do:
somefield: [filter op=12 interpolate=1][value whatever][/filter]
If there is a filter op that is just digits, it is assumed to be a length
limiter.
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.513.523.7621 <mike@perusion.com>
Friends don't let friends use Outlook. -- Bob Blaylock