From: max.valjanski@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14439: Trigger function fails with internal error after upgrade to 9.6
Date: Tue, 29 Nov 2016 14:16:39 +0000
Message-ID: <20161129141639.6530.37563@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14439
Logged by: Maxim Valyanskiy
Email address: max.valjanski@gmail.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$
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: max.valjanski@gmail.com
Subject: Re: BUG #14439: Trigger function fails with internal error after upgrade to 9.6
In-Reply-To: <20161129141639.6530.37563@wrigleys.postgresql.org>
References: <20161129141639.6530.37563@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox