Make self-referencing foreign key on repl_nodes table deferrable

This commit is contained in:
Ian Barwick
2016-04-01 15:19:22 +09:00
parent 5d32026b79
commit 5bc809466c
3 changed files with 52 additions and 1 deletions

View File

@@ -4505,7 +4505,7 @@ create_schema(PGconn *conn)
"CREATE TABLE %s.repl_nodes ( "
" id INTEGER PRIMARY KEY, "
" type TEXT NOT NULL CHECK (type IN('master','standby','witness')), "
" upstream_node_id INTEGER NULL REFERENCES %s.repl_nodes (id), "
" upstream_node_id INTEGER NULL REFERENCES %s.repl_nodes (id) DEFERRABLE, "
" cluster TEXT NOT NULL, "
" name TEXT NOT NULL, "
" conninfo TEXT NOT NULL, "