Re: [COMMITTERS] pgsql: Disallow changing/dropping default expression

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Disallow changing/dropping default expression
Date: 2006-06-27 15:15:47
Message-ID: 19931.1151421347@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Tom Lane wrote:
>> Wasn't this patch rejected?

> Anyway, what is your opinion on this?

I thought we'd rejected it. I'm not sure that we'd completely agreed
what the best thing to do is, but what this patch actually does is to
silently remove the dependency link. That is, after

create table t1 (f1 serial);
alter table t1 alter column f1 drop default;

t1_f1_seq is still there, but now completely unconnected to t1.
That doesn't seem to me to satisfy the principle of least surprise.
It's certainly not what the TODO item says (reject the DROP DEFAULT).
I think we were considering the alternative of having the DROP DEFAULT
remove the sequence, which probably could be implemented painlessly
with a change in the way we set up the dependency links to start with.

In any case I don't like this patch: int/bool confusion, use of elog
instead of ereport for a user-facing error message, failure to adhere to
style guidelines for that message, etc. (Although seeing that the error
message is unreachable code, maybe that doesn't matter ;-)) Aside from
the poor coding style, the whole idea of reaching into pg_depend to
remove a single dependency strikes me as a brute-force solution to
a problem that should have a more elegant answer.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2006-06-27 15:20:11 Re: pgsql: Clamp last_anl_tuples to n_live_tuples, in case we vacuum a table
Previous Message Tom Lane 2006-06-27 14:01:42 pgsql: Fix typo.

Browse pgsql-hackers by date

  From Date Subject
Next Message Yoshiyuki Asaba 2006-06-27 15:23:13 SO_SNDBUF size is small on win32?
Previous Message Martijn van Oosterhout 2006-06-27 14:20:41 Re: vacuum, performance, and MVCC