issues with dropped columns in plpgsql code again

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: issues with dropped columns in plpgsql code again
Date: 2013-05-07 19:19:58
Message-ID: CAFj8pRC8_-Vppe_sx7+jn-4UQ_YVXGdhWP5O0rtmv6qZxShmFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

One user reported a issues with triggers related to dropped columns.

When I checked his code, I found a more possible problems.

He use a trigger in form

$$
DECLARE somevar targettable;
BEGIN
somevar := NEW;
// do some with somevar;
RETURN somevar;
END;
$$

When I dropped column (I dropped numeric column) I had to finish session,
because I got a error in assign

LOCATION: exec_stmt_raise, pl_exec.c:2985
ERROR: 22P02: invalid input syntax for type numeric: "aaa"
CONTEXT: PL/pgSQL function f1_trg() line 4 at assignment
LOCATION: set_var_from_str, numeric.c:3253

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-05-07 19:23:04 Re: issues with dropped columns in plpgsql code again
Previous Message Stephen Frost 2013-05-07 19:03:31 Re: pg_dump --snapshot