Re: pg_dumpall and owner of the extension

From: kaido vaikla <kaido(dot)vaikla(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dumpall and owner of the extension
Date: 2024-01-23 16:40:15
Message-ID: CA+427g8Zgb5cf=D7+ZX7dzSB7af0Vf7ENQz3dLJbDkiNmRANnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Tom,
Before export i gave superuser privilege to extension owner.
Problem is not does user have privileges enough, but like you said
"Yeah, pg_dump makes no effort to restore extensions with the same
owner"
br
Kido

On Tue, 23 Jan 2024 at 18:30, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> kaido vaikla <kaido(dot)vaikla(at)gmail(dot)com> writes:
> > Yes, i have a real problem. To keep things clear in database, my design
> is:
> > - every application has own schema
> > - every schema has owner who is not a user postgres
> > - only schema owner can do DDL's on schema
>
> > So if some application needs some extensions, then i give temporary
> > suppersuser privilege to schema owner,
> > if "create extension" needs it, extensions are installed "with schema"
> > And revoke suppersuser privilege after extension inatall.
> > I'm not sure, is it my design against postgres concept or not :(.
>
> Well, it's certainly creating a problem for pg_dump: the alleged owner
> of the extension doesn't have enough privilege to install it. The
> easiest way to make pg_dump support this would be to have it issue
> something like
>
> SET ROLE extension_owner;
> CREATE EXTENSION foo;
> RESET ROLE;
>
> but that would fail for you.
>
> regards, tom lane
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rajesh Kumar 2024-01-23 20:58:07 Pgbouncer
Previous Message Tom Lane 2024-01-23 16:30:37 Re: pg_dumpall and owner of the extension