BUG #14439: Trigger function fails with internal error after upgrade to 9.6

From: max(dot)valjanski(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14439: Trigger function fails with internal error after upgrade to 9.6
Date: 2016-11-29 14:16:39
Message-ID: 20161129141639.6530.37563@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14439
Logged by: Maxim Valyanskiy
Email address: max(dot)valjanski(at)gmail(dot)com
PostgreSQL version: 9.6.1
Operating system: CentOS 6.8
Description:

Trigger function stopped working after upgrade from 9.5 to 9.6. Upgrade was
performed via pg_upgrade.

This is that error output:

# update ab_group set name='Domain Controllerz' where id=466;
ERROR: table row type and query-specified row type do not match
ПОДРОБНОСТИ: Query provides a value for a dropped column at ordinal
position 6.
КОНТЕКСТ: SQL statement "UPDATE ab_group SET name_gin =
to_tsvector('simple', NEW.name) WHERE id = NEW.id AND NEW.name <>
OLD.name"
PL/pgSQL function update_group_name_gin() line 4 at SQL statement

I tried to recreate function, made VACUUM FULL and CLUSTER for that table
and it did not fix the problem.

Here is source code for that function:

CREATE OR REPLACE FUNCTION public.update_group_name_gin()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGIN
IF (TG_OP = 'UPDATE') THEN
UPDATE ab_group SET name_gin = to_tsvector('simple',
NEW.name) WHERE id = NEW.id AND NEW.name <> OLD.name;
RETURN NEW;
ELSIF (TG_OP = 'INSERT') THEN
UPDATE ab_group SET name_gin = to_tsvector('simple',
NEW.name) WHERE id = NEW.id;
END IF;
RETURN NULL;
END;
$function$

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Day 2016-11-29 14:39:28 parallel sequential scan returns extraneous rows
Previous Message Michael Paquier 2016-11-29 04:24:52 Re: Re: BUG #13755: pgwin32_is_service not checking if SECURITY_SERVICE_SID is disabled