From: Bill MacArthur <webmaster@dhs-club.com>
To: pgsql-bugs@postgresql.org
Subject: table row type and query-specified row type do not match
Date: Thu, 08 Mar 2012 14:40:26 -0500
Message-ID: <4F590B2A.1030709@dhs-club.com> (raw)
Hello,
Perhaps this issue has been resolved in higher sub-versions or in 9.1?
In summary, the issue revolves around the data type of a column being changed, but the data type in a dependent rule on another table does not. Does the data type have to be embedded in the rule?
Sorry if the issue has already been discussed. Googling it didn't seem to turn up anything.
Thank you for a great product anyway!
Bill MacArthur
Postgres version: PostgreSQL 9.0.5 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50), 64-bit
OS version: CentOS release 5.7 (Final)
network=# create table test.a (id bigint);
CREATE TABLE
network=# create table test.b (id integer);
CREATE TABLE
^
network=# create rule testb_delete AS on delete to test.b DO INSERT INTO test.a (id) VALUES (old.id);
CREATE RULE
network=# insert into test.b (id) values (123);
INSERT 0 1
network=# delete from test.b;
DELETE 1
network=# select * from test.a;
id
-----
123
(1 row)
network=# alter table test.a alter column id type integer;
ALTER TABLE
network=# insert into test.b (id) values (12399);
INSERT 0 1
network=# delete from test.b;
ERROR: table row type and query-specified row type do not match
DETAIL: Table has type integer at ordinal position 1, but query expects bigint.
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: webmaster@dhs-club.com
Subject: Re: table row type and query-specified row type do not match
In-Reply-To: <4F590B2A.1030709@dhs-club.com>
References: <4F590B2A.1030709@dhs-club.com>
* 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