Skip site navigation (1) Skip section navigation (2)

RENAME RULE doesn't work with partitioned tables

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RENAME RULE doesn't work with partitioned tables
Date: 2017-04-11 09:54:34
Message-ID: 52d9c443-ec78-5c8a-7a77-0f34aad12b82@lab.ntt.co.jp (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackers
Just noticed that RangeVarCallbackForRenameRule() was not updated to
handle partitioned tables, causing the following bug:

create table parted_table (a int) partition by list (a);
create table part partition of parted_table for values in (1);
create rule parted_table_insert as on insert to parted_table
  do instead insert into part values (new.*);
alter rule parted_table_insert on parted_table
  rename to parted_table_insert_redirect;
-- ERROR:  "parted_table" is not a table or view

Attached fixes this and adds a test.  Added to open items list.

Thanks,
Amit

Attachment: 0001-Fix-RENAME-RULE-to-consider-partitioned-tables.patch
Description: text/x-diff (2.7 KB)

Responses

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2017-04-11 10:23:29
Subject: Re: Letting the client choose the protocol to use during a SASL exchange
Previous:From: Ashutosh BapatDate: 2017-04-11 09:53:13
Subject: Re: [sqlsmith] ERROR: badly formatted node string "RESTRICTINFO...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group