Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c7dd35

Browse files
committed
Fix opclass/opfamily identity strings
The original representation uses "opcname for amname", which is goodenough; but if we replace "for" with "using", we can apply the returnedidentity directly in a DROP command, as inDROP OPERATOR CLASS opcname USING amnameThis slightly simplifies code using object identities to programaticallyexecute commands on these kinds of objects.Note backwards-incompatible change:The previous representation dates back to 9.3 when object identitieswere introduced by commitf8348ea, but we don't want to change thebehavior on released branches unnecessarily and so this is notbackpatched.
1 parent0d90679 commit9c7dd35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/backend/catalog/objectaddress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,7 +3533,7 @@ getObjectIdentityParts(const ObjectAddress *object,
35333533
appendStringInfoString(&buffer,
35343534
quote_qualified_identifier(schema,
35353535
NameStr(opcForm->opcname)));
3536-
appendStringInfo(&buffer,"for %s",
3536+
appendStringInfo(&buffer,"USING %s",
35373537
quote_identifier(NameStr(amForm->amname)));
35383538
if (objname)
35393539
{
@@ -4070,7 +4070,7 @@ getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **objname, List **objargs
40704070
amForm= (Form_pg_am)GETSTRUCT(amTup);
40714071

40724072
schema=get_namespace_name(opfForm->opfnamespace);
4073-
appendStringInfo(buffer,"%sfor %s",
4073+
appendStringInfo(buffer,"%sUSING %s",
40744074
quote_qualified_identifier(schema,
40754075
NameStr(opfForm->opfname)),
40764076
NameStr(amForm->amname));

‎src/test/regress/expected/object_address.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,11 @@ SELECT (pg_identify_object(addr1.classid, addr1.objid, addr1.subobjid)).*,
373373
conversion | pg_catalog | ascii_to_mic | pg_catalog.ascii_to_mic | t
374374
language | | plpgsql | plpgsql | t
375375
schema | | addr_nsp | addr_nsp | t
376-
operator class | pg_catalog | int4_ops | pg_catalog.int4_opsfor btree | t
376+
operator class | pg_catalog | int4_ops | pg_catalog.int4_opsUSING btree | t
377377
operator | pg_catalog | | pg_catalog.+(integer,integer) | t
378378
rule | | | "_RETURN" on addr_nsp.genview | t
379379
trigger | | | t on addr_nsp.gentable | t
380-
operator family | pg_catalog | integer_ops | pg_catalog.integer_opsfor btree | t
380+
operator family | pg_catalog | integer_ops | pg_catalog.integer_opsUSING btree | t
381381
policy | | | genpol on addr_nsp.gentable | t
382382
collation | pg_catalog | "default" | pg_catalog."default" | t
383383
text search dictionary | addr_nsp | addr_ts_dict | addr_nsp.addr_ts_dict | t

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp