@@ -101,11 +101,15 @@ CREATE TABLE measurement_y2006m03 PARTITION OF measurement_aux
101
101
```
102
102
103
103
* It's essential that both the source (` measurement ` ) and target
104
- (` measurement_aux ` ) table have an identity index. The easiest way to ensure
105
- this is to create ` PRIMARY KEY ` or ` UNIQUE ` constraint. Also note that the key
106
- (i.e. column list) of the identity index of the source and target table must
107
- be identical. The identity is needed to process data changes that applications
108
- make while data is being copied from the source to the target table.*
104
+ (` measurement_aux ` ) table have an identity index. It is needed to process data
105
+ changes that applications make while data is being copied from the source to
106
+ the target table. If the replica identity of the table is DEFAULT or FULL,
107
+ primary key constraint provides the identity index. If your table has no
108
+ primary key, you need to set the identity index explicitly using the [ ALTER
109
+ COMMAND ... REPLICA IDENTITY USING INDEX ...] [ 1 ] command.
110
+
111
+ Also note that the key (i.e. column list) of the identity index of the source
112
+ and target table must be identical.*
109
113
110
114
Then, in order to copy the data into the target table, run the
111
115
` rewrite_table() ` function and pass it both the source and target table, as
@@ -241,7 +245,8 @@ it needs.
241
245
a table which is being rewritten.
242
246
243
247
2 . The ` rewrite_table() ` function allows for MVCC-unsafe behavior described in
244
- the first paragraph of [ mvcc-caveats] [ 1 ] .
248
+ the first paragraph of [ mvcc-caveats] [ 2 ] .
245
249
246
250
247
- [ 1 ] : https://www.postgresql.org/docs/current/mvcc-caveats.html
251
+ [ 1] https://www.postgresql.org/docs/17/sql-altertable.html
252
+ [ 2] https://www.postgresql.org/docs/current/mvcc-caveats.html
0 commit comments