1ALTER PUBLICATION(7) PostgreSQL 11.3 Documentation ALTER PUBLICATION(7)
2
3
4
6 ALTER_PUBLICATION - change the definition of a publication
7
9 ALTER PUBLICATION name ADD TABLE [ ONLY ] table_name [ * ] [, ...]
10 ALTER PUBLICATION name SET TABLE [ ONLY ] table_name [ * ] [, ...]
11 ALTER PUBLICATION name DROP TABLE [ ONLY ] table_name [ * ] [, ...]
12 ALTER PUBLICATION name SET ( publication_parameter [= value] [, ... ] )
13 ALTER PUBLICATION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
14 ALTER PUBLICATION name RENAME TO new_name
15
17 The command ALTER PUBLICATION can change the attributes of a
18 publication.
19
20 The first three variants change which tables are part of the
21 publication. The SET TABLE clause will replace the list of tables in
22 the publication with the specified one. The ADD TABLE and DROP TABLE
23 clauses will add and remove one or more tables from the publication.
24 Note that adding tables to a publication that is already subscribed to
25 will require a ALTER SUBSCRIPTION ... REFRESH PUBLICATION action on the
26 subscribing side in order to become effective.
27
28 The fourth variant of this command listed in the synopsis can change
29 all of the publication properties specified in CREATE PUBLICATION
30 (CREATE_PUBLICATION(7)). Properties not mentioned in the command retain
31 their previous settings.
32
33 The remaining variants change the owner and the name of the
34 publication.
35
36 You must own the publication to use ALTER PUBLICATION. To alter the
37 owner, you must also be a direct or indirect member of the new owning
38 role. The new owner must have CREATE privilege on the database. Also,
39 the new owner of a FOR ALL TABLES publication must be a superuser.
40 However, a superuser can change the ownership of a publication while
41 circumventing these restrictions.
42
44 name
45 The name of an existing publication whose definition is to be
46 altered.
47
48 table_name
49 Name of an existing table. If ONLY is specified before the table
50 name, only that table is affected. If ONLY is not specified, the
51 table and all its descendant tables (if any) are affected.
52 Optionally, * can be specified after the table name to explicitly
53 indicate that descendant tables are included.
54
55 SET ( publication_parameter [= value] [, ... ] )
56 This clause alters publication parameters originally set by CREATE
57 PUBLICATION (CREATE_PUBLICATION(7)). See there for more
58 information.
59
60 new_owner
61 The user name of the new owner of the publication.
62
63 new_name
64 The new name for the publication.
65
67 Change the publication to publish only deletes and updates:
68
69 ALTER PUBLICATION noinsert SET (publish = 'update, delete');
70
71 Add some tables to the publication:
72
73 ALTER PUBLICATION mypublication ADD TABLE users, departments;
74
76 ALTER PUBLICATION is a PostgreSQL extension.
77
79 CREATE PUBLICATION (CREATE_PUBLICATION(7)), DROP PUBLICATION
80 (DROP_PUBLICATION(7)), CREATE SUBSCRIPTION (CREATE_SUBSCRIPTION(7)),
81 ALTER SUBSCRIPTION (ALTER_SUBSCRIPTION(7))
82
83
84
85PostgreSQL 11.3 2019 ALTER PUBLICATION(7)