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

Commit12bd7dd

Browse files
committed
Use TSConfigRelationId in AlterTSConfiguration()
When we are altering a text search configuration, we are getting thetuple from pg_ts_config and using its OID, so use TSConfigRelationIdwhen invoking any post-alter hooks and setting the object address.Further, in the functions called from AlterTSConfiguration(), we'resaving information about the command viaEventTriggerCollectAlterTSConfig(), so we should be settingcommandCollected to true. Also add a regression test totest_ddl_deparse for ALTER TEXT SEARCH CONFIGURATION.Author: Artur Zakirov, a few additional comments by meDiscussion:https://www.postgresql.org/message-id/57a71eba-f2c7-e7fd-6fc0-2126ec0b39bd%40postgrespro.ruBack-patch the fix for the InvokeObjectPostAlterHook() call to 9.3 whereit was introduced, and the fix for the ObjectAddressSet() call andsetting commandCollected to true to 9.5 where those changes toProcessUtilitySlow() were introduced.
1 parent1ead020 commit12bd7dd

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

‎src/backend/commands/tsearchcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,10 +1215,10 @@ AlterTSConfiguration(AlterTSConfigurationStmt *stmt)
12151215
/* Update dependencies */
12161216
makeConfigurationDependencies(tup, true,relMap);
12171217

1218-
InvokeObjectPostAlterHook(TSConfigMapRelationId,
1218+
InvokeObjectPostAlterHook(TSConfigRelationId,
12191219
HeapTupleGetOid(tup),0);
12201220

1221-
ObjectAddressSet(address,TSConfigMapRelationId,cfgId);
1221+
ObjectAddressSet(address,TSConfigRelationId,cfgId);
12221222

12231223
heap_close(relMap,RowExclusiveLock);
12241224

‎src/backend/tcop/utility.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,13 @@ ProcessUtilitySlow(ParseState *pstate,
14791479
break;
14801480

14811481
caseT_AlterTSConfigurationStmt:
1482-
address=AlterTSConfiguration((AlterTSConfigurationStmt*)parsetree);
1482+
AlterTSConfiguration((AlterTSConfigurationStmt*)parsetree);
1483+
/*
1484+
* Commands are stashed in MakeConfigurationMapping and
1485+
* DropConfigurationMapping, which are called from
1486+
* AlterTSConfiguration
1487+
*/
1488+
commandCollected= true;
14831489
break;
14841490

14851491
caseT_AlterTableMoveAllStmt:

‎src/test/modules/test_ddl_deparse/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ REGRESS = test_ddl_deparse \
2323
comment_on\
2424
alter_function\
2525
alter_sequence\
26+
alter_ts_config\
2627
alter_type_enum\
2728
opfamily\
2829
defprivs\
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--
2+
-- ALTER TEXT SEARCH CONFIGURATION
3+
--
4+
CREATE TEXT SEARCH CONFIGURATION en (copy=english);
5+
NOTICE: DDL test: type simple, tag CREATE TEXT SEARCH CONFIGURATION
6+
ALTER TEXT SEARCH CONFIGURATION en
7+
ALTER MAPPING FOR host, email, url, sfloat WITH simple;
8+
NOTICE: DDL test: type alter text search configuration, tag ALTER TEXT SEARCH CONFIGURATION
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--
2+
-- ALTER TEXT SEARCH CONFIGURATION
3+
--
4+
5+
CREATETEXT SEARCH CONFIGURATION en (copy=english);
6+
7+
ALTERTEXT SEARCH CONFIGURATION en
8+
ALTER MAPPING FOR host, email, url, sfloat WITH simple;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp