From: | Vijaykumar Jain <vijaykumarjain(dot)github(at)gmail(dot)com> |
---|---|
To: | Christian Lehmann <info(at)chlehmann(dot)ch> |
Cc: | Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Migration struggles |
Date: | 2021-08-03 15:05:36 |
Message-ID: | CAM+6J97VQRbWa9djZwDUjPJ5v5YjexYsrTbgcXSH4F_vvHyasA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Tue, 3 Aug 2021 at 20:25, Christian Lehmann <info(at)chlehmann(dot)ch> wrote:
> Hi there
> Well, migration itself won't be triggered by ansible (maybe in the
> future, but then -c for sure will be used!). But I honestly did not
> try --if-exists because there is no "create role abc if not exists".
> But maybe it handles role-creation differently, I will try that.
>
>
there is no "create role if not exists",
it would use "if exists" to drop the objects and the create the objects
normally.
PostgreSQL: Documentation: 13: DROP ROLE
<https://www.postgresql.org/docs/current/sql-droprole.html>
from a dummy dumpall
egrep -i 'DROP|CREATE' dump.sql
-- Drop databases (except postgres and template1)
DROP DATABASE IF EXISTS vjain;
-- Drop roles
DROP ROLE IF EXISTS postgres;
DROP ROLE IF EXISTS vjain;
CREATE ROLE postgres;
and so on..
From | Date | Subject | |
---|---|---|---|
Next Message | Eko Prasetiyo | 2021-08-03 15:19:06 | |
Previous Message | Christian Lehmann | 2021-08-03 14:55:28 | Re: Migration struggles |