init: avoid errors when creating existing resources
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
f7720f0d5a
commit
fbc3376e79
|
@ -3,7 +3,13 @@
|
||||||
|
|
||||||
-- Users
|
-- Users
|
||||||
{% for user in (postgres_ha_users + postgres_ha_databases) %}
|
{% for user in (postgres_ha_users + postgres_ha_databases) %}
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
CREATE USER "{{ user.name | mandatory }}" PASSWORD '{{ user.pass | mandatory }}';
|
CREATE USER "{{ user.name | mandatory }}" PASSWORD '{{ user.pass | mandatory }}';
|
||||||
|
EXCEPTION WHEN duplicate_object THEN
|
||||||
|
RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
-- Databases
|
-- Databases
|
||||||
|
|
Loading…
Reference in New Issue