Use TSConfigRelationId in AlterTSConfiguration()
authorStephen Frost <sfrost@snowman.net>
Thu, 22 Dec 2016 22:08:43 +0000 (17:08 -0500)
committerStephen Frost <sfrost@snowman.net>
Thu, 22 Dec 2016 22:08:43 +0000 (17:08 -0500)
commit12bd7dd317e8f4346fb3507578aca790ede6ebea
tree306e24b56942d7e23c698763e29da813785d2c70
parent1ead0208b2178089b024caa2d1465a3f3056a45c
Use TSConfigRelationId in AlterTSConfiguration()

When we are altering a text search configuration, we are getting the
tuple from pg_ts_config and using its OID, so use TSConfigRelationId
when invoking any post-alter hooks and setting the object address.

Further, in the functions called from AlterTSConfiguration(), we're
saving information about the command via
EventTriggerCollectAlterTSConfig(), so we should be setting
commandCollected to true.  Also add a regression test to
test_ddl_deparse for ALTER TEXT SEARCH CONFIGURATION.

Author: Artur Zakirov, a few additional comments by me
Discussion: https://www.postgresql.org/message-id/57a71eba-f2c7-e7fd-6fc0-2126ec0b39bd%40postgrespro.ru

Back-patch the fix for the InvokeObjectPostAlterHook() call to 9.3 where
it was introduced, and the fix for the ObjectAddressSet() call and
setting commandCollected to true to 9.5 where those changes to
ProcessUtilitySlow() were introduced.
src/backend/commands/tsearchcmds.c
src/backend/tcop/utility.c
src/test/modules/test_ddl_deparse/Makefile
src/test/modules/test_ddl_deparse/expected/alter_ts_config.out [new file with mode: 0644]
src/test/modules/test_ddl_deparse/sql/alter_ts_config.sql [new file with mode: 0644]