summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera2015-02-18 17:44:27 +0000
committerAlvaro Herrera2015-02-18 17:44:27 +0000
commit9c7dd350199fa030ccbd5538e1b8e13a9603fda4 (patch)
tree017b97c385350ee6d1774a57ab8e6c9ee89468c0 /src
parent0d906798f680b2dd86cbc8d31ba64685aeb12092 (diff)
Fix opclass/opfamily identity strings
The original representation uses "opcname for amname", which is good enough; but if we replace "for" with "using", we can apply the returned identity directly in a DROP command, as in DROP OPERATOR CLASS opcname USING amname This slightly simplifies code using object identities to programatically execute commands on these kinds of objects. Note backwards-incompatible change: The previous representation dates back to 9.3 when object identities were introduced by commit f8348ea3, but we don't want to change the behavior on released branches unnecessarily and so this is not backpatched.
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/objectaddress.c4
-rw-r--r--src/test/regress/expected/object_address.out4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 2f407337fbf..d899dd73fef 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -3533,7 +3533,7 @@ getObjectIdentityParts(const ObjectAddress *object,
appendStringInfoString(&buffer,
quote_qualified_identifier(schema,
NameStr(opcForm->opcname)));
- appendStringInfo(&buffer, " for %s",
+ appendStringInfo(&buffer, " USING %s",
quote_identifier(NameStr(amForm->amname)));
if (objname)
{
@@ -4070,7 +4070,7 @@ getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **objname, List **objargs
amForm = (Form_pg_am) GETSTRUCT(amTup);
schema = get_namespace_name(opfForm->opfnamespace);
- appendStringInfo(buffer, "%s for %s",
+ appendStringInfo(buffer, "%s USING %s",
quote_qualified_identifier(schema,
NameStr(opfForm->opfname)),
NameStr(amForm->amname));
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index 05e0e12845e..dcf1b46ecd7 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -373,11 +373,11 @@ SELECT (pg_identify_object(addr1.classid, addr1.objid, addr1.subobjid)).*,
conversion | pg_catalog | ascii_to_mic | pg_catalog.ascii_to_mic | t
language | | plpgsql | plpgsql | t
schema | | addr_nsp | addr_nsp | t
- operator class | pg_catalog | int4_ops | pg_catalog.int4_ops for btree | t
+ operator class | pg_catalog | int4_ops | pg_catalog.int4_ops USING btree | t
operator | pg_catalog | | pg_catalog.+(integer,integer) | t
rule | | | "_RETURN" on addr_nsp.genview | t
trigger | | | t on addr_nsp.gentable | t
- operator family | pg_catalog | integer_ops | pg_catalog.integer_ops for btree | t
+ operator family | pg_catalog | integer_ops | pg_catalog.integer_ops USING btree | t
policy | | | genpol on addr_nsp.gentable | t
collation | pg_catalog | "default" | pg_catalog."default" | t
text search dictionary | addr_nsp | addr_ts_dict | addr_nsp.addr_ts_dict | t