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>, PgHacker <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: ALTER command reworks |
Date: | 2012-10-17 20:09:24 |
Message-ID: | 20121017200924.GK5217@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Kohei KaiGai escribió:
> 2012/10/5 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
> The attached patch fixes the messaging issue.
> I newly add func_signature_string_oid() that returns compatible function's
> signature, but takes its object-id.
>
> So, the error message is now constructed as:
> + case OBJECT_AGGREGATE:
> + case OBJECT_FUNCTION:
> + errorm = format_elog_string("function %s already exists in
> schema \"%s\"",
> + func_signature_string_oid(objectId),
> + get_namespace_name(namespaceId));
> + break;
Thanks, yeah, this works for me.
I am now wondering if it would make sense to merge the duplicate-name
error cases in AlterObjectNamespace_internal and
AlterObjectRename_internal. The former only works when there is a name
catcache for the object type. Maybe we can create a single function to
which we give the object type, name/args, oid, etc, and it uses a
catcache if available and falls back to get_object_address (with the
IMO ugly name list manipulations) if not.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2012-10-17 20:12:53 | Re: Deprecating RULES |
Previous Message | Josh Berkus | 2012-10-17 20:03:28 | Re: Deprecating RULES |