File: alter_publication.sql

package info (click to toggle)
sqlfluff 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,000 kB
  • sloc: python: 106,131; sql: 34,188; makefile: 52; sh: 8
file content (33 lines) | stat: -rw-r--r-- 1,138 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- More thorough testing of the PublicationObjectsSegment is in postgres_create_publication.sql.

ALTER PUBLICATION abc ADD TABLE def;

ALTER PUBLICATION abc ADD TABLE def, TABLE ghi;

ALTER PUBLICATION abc ADD TABLE def, ghi*, ONLY jkl, ONLY (mno);

ALTER PUBLICATION abc SET TABLE def, ghi, TABLES IN SCHEMA y, z, CURRENT_SCHEMA;

ALTER PUBLICATION abc SET (publish = 'insert,update', publish_via_partition_root = TRUE);

ALTER PUBLICATION abc OWNER TO bob;

ALTER PUBLICATION abc OWNER TO CURRENT_ROLE;

ALTER PUBLICATION abc OWNER TO CURRENT_USER;

ALTER PUBLICATION abc OWNER TO SESSION_USER;

ALTER PUBLICATION abc RENAME TO def;

-- examples from https://www.postgresql.org/docs/15/sql-alterpublication.html

ALTER PUBLICATION noinsert SET (publish = 'update, delete');

ALTER PUBLICATION mypublication ADD TABLE users (user_id, firstname), departments;

ALTER PUBLICATION mypublication SET TABLE users (user_id, firstname, lastname), TABLE departments;

ALTER PUBLICATION sales_publication ADD TABLES IN SCHEMA marketing, sales;

ALTER PUBLICATION production_publication ADD TABLE users, departments, TABLES IN SCHEMA production;