|
1 | 1 | -- |
2 | | --- extension update file from 1.4 to 1.5 |
| 2 | +-- extension update file from 1.4.2 to 1.5.1 |
3 | 3 | -- |
4 | 4 | -- complain if script is sourced in psql, rather than via CREATE EXTENSION |
5 | 5 | \echo Use "CREATE EXTENSION pgautofailover" to load this file. \quit |
|
48 | 48 | and groupid = 0 |
49 | 49 | and nodecluster = cluster_name; |
50 | 50 | $$; |
| 51 | + |
| 52 | +DROP FUNCTION IF EXISTS |
| 53 | + pgautofailover.register_node(text,text,int,name,text,bigint,int, |
| 54 | + pgautofailover.replication_state,text, |
| 55 | + int,bool,text); |
| 56 | + |
| 57 | +CREATE FUNCTION pgautofailover.register_node |
| 58 | + ( |
| 59 | + IN formation_id text, |
| 60 | + IN node_host text, |
| 61 | + IN node_port int, |
| 62 | + IN dbname name, |
| 63 | + IN node_name text default '', |
| 64 | + IN sysidentifier bigint default 0, |
| 65 | + IN desired_node_id int default -1, |
| 66 | + IN desired_group_id int default -1, |
| 67 | + IN initial_group_role pgautofailover.replication_state default 'init', |
| 68 | + IN node_kind text default 'standalone', |
| 69 | + IN candidate_priority int default 100, |
| 70 | + IN replication_quorum bool default true, |
| 71 | + IN node_cluster text default 'default', |
| 72 | + OUT assigned_node_id int, |
| 73 | + OUT assigned_group_id int, |
| 74 | + OUT assigned_group_state pgautofailover.replication_state, |
| 75 | + OUT assigned_candidate_priority int, |
| 76 | + OUT assigned_replication_quorum bool, |
| 77 | + OUT assigned_node_name text |
| 78 | + ) |
| 79 | +RETURNS record LANGUAGE C STRICT SECURITY DEFINER |
| 80 | +AS 'MODULE_PATHNAME', $$register_node$$; |
| 81 | + |
| 82 | +grant execute on function |
| 83 | + pgautofailover.register_node(text,text,int,name,text,bigint,int,int, |
| 84 | + pgautofailover.replication_state,text, |
| 85 | + int,bool,text) |
| 86 | + to autoctl_node; |
0 commit comments