ERROR: invalid input syntax for integer: "0A000"

From: "McLaughlin, Michael" <McLaughlinM(at)byui(dot)edu>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: ERROR: invalid input syntax for integer: "0A000"
Date: 2019-10-13 17:44:25
Message-ID: B73099F5-D7ED-4C9E-9A39-D00EA31F5662@byui.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Code including test:

-- Transaction Management Example.
DROP PROCEDURE IF EXISTS testing;

-- Transaction Management Example.
CREATE OR REPLACE PROCEDURE testing
( IN pv_one VARCHAR(30)
, IN pv_two VARCHAR(10)) AS
$$
DECLARE
/* Declare error handling variables. */
err_num INTEGER;
err_msg INTEGER;
BEGIN
/* Create a SAVEPOINT as a starting point. */
SAVEPOINT starting_point;

/* Log actual parameter values. */
INSERT INTO msg VALUES (pv_one||'.'||pv_two);

/* Commit the series of inserts. */
COMMIT;

EXCEPTION
WHEN OTHERS THEN
err_num := SQLSTATE;
err_msg := SUBSTR(SQLERRM,1,100);
RAISE NOTICE 'Trapped Error: %', err_msg;
END
$$ LANGUAGE plpgsql;

do $$
DECLARE
lv_one VARCHAR(30) := 'INDIVIDUAL';
lv_two VARCHAR(19) := 'R11-514-34';
BEGIN
RAISE NOTICE '[%]', lv_one;
RAISE NOTICE '[%]', lv_two;
CALL testing( pv_one := lv_one, pv_two := lv_two );
END
$$;

SELECT * FROM msg;

Running the code:

videodb=> \i twoflat.sql
DROP PROCEDURE
CREATE PROCEDURE
psql:twoflat.sql:58: NOTICE: [INDIVIDUAL]
psql:twoflat.sql:58: NOTICE: [R11-514-34]
psql:twoflat.sql:58: ERROR: invalid input syntax for integer: "0A000"
CONTEXT: PL/pgSQL function testing(character varying,character varying) line 17 at assignment
SQL statement "CALL testing( pv_one := lv_one, pv_two := lv_two )"
PL/pgSQL function inline_code_block line 8 at CALL
comment
---------
(0 rows)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-10-13 18:26:48 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12
Previous Message Tomas Vondra 2019-10-13 00:10:32 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12