Re: recent ALTER whatever .. SET SCHEMA refactoring

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: recent ALTER whatever .. SET SCHEMA refactoring
Date: 2013-01-14 22:27:53
Message-ID: 20130114222753.GG5106@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kohei KaiGai escribió:

> I'm probably saying same idea. It just adds invocation of external
> functions to check naming conflicts of functions or collation; that
> takes additional 4-lines for special case handling
> in AlterObjectNamespace_internal().

Okay, I can agree with this implementation plan. I didn't like your
patch very much though; I'm not sure that the handling of collations was
sane. And the names of the AlterFooNamespace_oid() functions is now
completely misleading, because they no longer do that. So I renamed
them, and while at it I noticed that the collation case can share code
with the RENAME code path; the function case could probably do likewise,
but it becomes uglier.

Note that after this patch, the error message now cites the function
signature, not just the name. This is more consistent with other cases.

9.2 and HEAD:
alvherre=# alter function foo.f(int,int) set schema bar;
ERROR: function "f" already exists in schema "bar"
(this error is misleading, because there can validly be a f(int)
function in schema bar and that wouldn't cause a problem for this SET
SCHEMA command).

After my patch:
alvherre=# alter function foo.f(int,int) set schema bar;
ERROR: function f(integer, integer) already exists in schema "bar"

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
pgsql-v9.3-alter-namespace-specials-2.patch text/x-diff 15.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2013-01-14 22:31:42 Patches for TODO item: Avoid truncating empty OCDR temp tables on COMMIT
Previous Message Andres Freund 2013-01-14 22:27:07 s/size_t/off_t/ in sendTimeLineHistory