David ZhangD
Windmillโ€ข2y agoโ€ข
9 replies
David Zhang

Postgres err: insufficient data left in message

I'm not sure how to approach debugging this issue
For this query and inputs (in screenshot) I'm getting the error: ExecutionErr: error during execution of the script: db error: ERROR: insufficient data left in message

-- $1 user_guid
-- $2 network
-- $3 asset
-- $4 direction
-- $5 count_limit
-- $6 amount_limit
-- $7 amount_minimum
INSERT INTO stably.limit_user (
    user_guid,
    network,
    asset,
    direction,
    count_limit,
    amount_limit,
    amount_minimum
)
VALUES (
    $1::UUID,
    $2::VARCHAR,
    $3::VARCHAR,
    $4::VARCHAR,
    $5::INT,
    $6::NUMERIC,
    $7::NUMERIC
)
ON CONFLICT (user_guid, network, direction) 
DO UPDATE SET
    asset = EXCLUDED.asset,
    direction = EXCLUDED.direction,
    count_limit = EXCLUDED.count_limit,
    amount_limit = EXCLUDED.amount_limit,
    amount_minimum = EXCLUDED.amount_minimum;


I've tried running this exact same query with the same arguments in another Postgres client (screenshot) but the query runs successfully. I've tried changing the casting syntax but there's too many permutations to try. Is there a way to get more context on the error somehow? There's nothing useful in the logs either
image.png
image.png
Was this page helpful?