Skip to content

Commit c61cb62

Browse files
authored
add more info on init_callbacks to README.md
1 parent 84b3b69 commit c61cb62

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,24 @@ Enable/disable auto partition propagation (only for RANGE partitioning). It is e
209209
```plpgsql
210210
set_init_callback(relation REGCLASS, callback REGPROC DEFAULT 0)
211211
```
212-
Set partition creation callback to be invoked for each attached or created partition (both HASH and RANGE).
212+
Set partition creation callback to be invoked for each attached or created partition (both HASH and RANGE). The callback must have the following signature: `part_init_callback(args JSONB) RETURNS VOID`. Parameter `arg` consists of several fields whose presence depends on partitioning type:
213+
```json
214+
/* RANGE-partitioned table abc (child abc_4) */
215+
{
216+
"parent": "abc",
217+
"parttype": "2",
218+
"partition": "abc_4",
219+
"range_max": "401",
220+
"range_min": "301"
221+
}
222+
223+
/* HASH-partitioned table abc (child abc_0) */
224+
{
225+
"parent": "abc",
226+
"parttype": "1",
227+
"partition": "abc_0"
228+
}
229+
```
213230

214231
## Views and tables
215232

0 commit comments

Comments
 (0)