renaming domain constraint

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: renaming domain constraint
Date: 2012-03-16 17:34:52
Message-ID: 1331919292.8940.3.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Here is a patch for being able to rename constraints of domains. It
goes on top of the previously committed patch for renaming table
constraints.

Attachment Content-Type Size
rename-domain-constraint.patch text/x-patch 14.9 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: renaming domain constraint
Date: 2012-03-21 14:43:17
Message-ID: CA+TgmoZxukJ29RwTh-TA9o2G0FjFgMdjm5Sbbo6n2zavHkYx6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Mar 16, 2012 at 1:34 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Here is a patch for being able to rename constraints of domains.  It
> goes on top of the previously committed patch for renaming table
> constraints.

I don't like the way you've modified get_constraint_oid(), which is
currently parallel to many other get_whatever_oid() functions and with
this patch, would no longer be. There seems to be little point in
shoehorning the new functionality into the existing function anyway,
considering that you've conditionalized basically every piece of logic
in the function. I think you should just invent a completely separate
function and be done with it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: renaming domain constraint
Date: 2012-03-21 14:57:53
Message-ID: 1332341821-sup-5573@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Excerpts from Robert Haas's message of mié mar 21 11:43:17 -0300 2012:
> On Fri, Mar 16, 2012 at 1:34 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > Here is a patch for being able to rename constraints of domains.  It
> > goes on top of the previously committed patch for renaming table
> > constraints.
>
> I don't like the way you've modified get_constraint_oid(), which is
> currently parallel to many other get_whatever_oid() functions and with
> this patch, would no longer be. There seems to be little point in
> shoehorning the new functionality into the existing function anyway,
> considering that you've conditionalized basically every piece of logic
> in the function. I think you should just invent a completely separate
> function and be done with it.

get_relation_constraint_oid() plus get_domain_constraint_oid()?

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: renaming domain constraint
Date: 2012-03-22 18:45:27
Message-ID: 1332441927.31263.0.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On ons, 2012-03-21 at 11:57 -0300, Alvaro Herrera wrote:
> Excerpts from Robert Haas's message of mié mar 21 11:43:17 -0300 2012:
> > On Fri, Mar 16, 2012 at 1:34 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > > Here is a patch for being able to rename constraints of domains. It
> > > goes on top of the previously committed patch for renaming table
> > > constraints.
> >
> > I don't like the way you've modified get_constraint_oid(), which is
> > currently parallel to many other get_whatever_oid() functions and with
> > this patch, would no longer be. There seems to be little point in
> > shoehorning the new functionality into the existing function anyway,
> > considering that you've conditionalized basically every piece of logic
> > in the function. I think you should just invent a completely separate
> > function and be done with it.
>
> get_relation_constraint_oid() plus get_domain_constraint_oid()?

Makes sense. Updated patch attached.

Attachment Content-Type Size
rename-domain-constraint-v2.patch text/x-patch 14.2 KB