-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveRecord::RangeError: PG::NumericValueOutOfRange: ERROR: value overflows numeric format #69
Comments
The problem is with
One way to solve this is to avoid |
Hi @palkan, thanks for looking into this so quickly. This gem is brilliant btw, thank you so much for your effort. I see that the docs for hstore_to_jsonb_loose say:
This is exactly the problem. It looks as though this should have been fixed in 9.6 commited postgres/postgres@e09996f#diff-0f8b296e470f9ba30622ac12b4cea554 and again amended postgres/postgres@41d2c08#diff-0f8b296e470f9ba30622ac12b4cea554
And yet the the problem still exists. I'm going to try and look into the bug on |
I think maybe this should be in the README as a possible error raised by We've recently gotten this a few times in
relatedly, while I'm here: I'd also appreciate if there were an error_handling function which I could define to 'rescue' any errors inside logidze without failing the transaction. I do this for a number of my other function. e.g. EXCEPTION
-- https://www.postgresql.org/docs/11/errcodes-appendix.html
-- https://www.postgresql.org/docs/11/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
WHEN DEADLOCK_DETECTED OR QUERY_CANCELED OR LOCK_NOT_AVAILABLE THEN
RAISE WARNING 'APP_NOTICE: DATABASE ERROR DETECTED: function % on invoice_ids %. running: %\n', fn_name, invoice_ids, current_query();
GET STACKED DIAGNOSTICS
_db_err_sql_state := RETURNED_SQLSTATE,
_db_err_message := MESSAGE_TEXT,
_db_err_detail := PG_EXCEPTION_DETAIL,
_db_err_hint := PG_EXCEPTION_HINT,
_db_err_context := PG_EXCEPTION_CONTEXT;
IF COALESCE(current_setting('logidze.meta', true), '') <> '' THEN
_db_err_responsible_id := current_setting('logidze.meta')::text;
END IF;
INSERT INTO database_errors (
sql_state, message, detail, hint, context,
fn_name, fn_args, current_query, responsible_id
) VALUES (
_db_err_sql_state, _db_err_message, _db_err_detail, _db_err_hint, _db_err_context,
fn_name, quote_literal(invoice_ids::text), current_query()::text, _db_err_responsible_id
); |
@bf4 Thanks for the suggestion! Updated the Readme and will create a separate issue regarding exceptions handling. |
I'm having a problem with any string that appears to be in scientific notation. For instance '557236406134e62000323100'.
The specific error is:
Postgres version: 9.6
Edit: I have my suspicions that it is because of the to_jsonb method.
I believe
to_jsonb
is erroneously attempting to typecast the string, could this be a bug in PG?The text was updated successfully, but these errors were encountered: