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

pgsql: Make INSERT/UPDATE queries depend on their specific targetcolum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make INSERT/UPDATE queries depend on their specific targetcolum
Date: 2012-03-11 22:14:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Make INSERT/UPDATE queries depend on their specific target columns.

We have always created a whole-table dependency for the target relation,
but that's not really good enough, as it doesn't prevent scenarios such
as dropping an individual target column or altering its type.  So we
have to create an individual dependency for each target column, as well.

Per report from Bill MacArthur of a rule containing UPDATE breaking
after such an alteration.  Note that this patch doesn't try to make
such cases work, only to ensure that the attempted ALTER TABLE throws
an error telling you it can't cope with adjusting the rule.

This is a long-standing bug, but given the lack of prior reports
I'm not going to risk back-patching it.  A back-patch wouldn't do
anything to fix existing rules' dependency lists, anyway.



Modified Files
src/backend/catalog/dependency.c |   31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)

pgsql-committers by date

Next:From: User FxjrDate: 2012-03-12 01:59:10
Subject: npgsql - Npgsql2: [#1011174] Requesting the REPEATABLE READ isolation
Previous:From: Tom LaneDate: 2012-03-11 20:56:49
Subject: pgsql: Make parameter name consistent with syntax summary.

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