pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thorsten Schöning <tschoening@am-soft.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to restore a dump containing CASTs into a database with a new user?
Date: Mon, 20 Jul 2020 17:10:23 +0200
Message-ID: <486383440.20200720171023@am-soft.de> (raw)
In-Reply-To: <FD2BE542-D6BD-49A2-B5B0-F6DCDB5CB960@thebuild.com>
References: <1566481610.20200719202547@am-soft.de>
	<206414.1595183867@sss.pgh.pa.us>
	<1834098334.20200719215112@am-soft.de>
	<229216.1595191074@sss.pgh.pa.us>
	<929298897.20200719232557@am-soft.de>
	<B84FCC25-E4EE-4441-9788-9324FD9E0D2B@thebuild.com>
	<1097194106.20200720071316@am-soft.de>
	<D9A7BBE5-3AE4-4AE6-A267-853704EF84E9@thebuild.com>
	<315697639.20200720112813@am-soft.de>
	<FD2BE542-D6BD-49A2-B5B0-F6DCDB5CB960@thebuild.com>

Guten Tag Christophe Pettus,
am Montag, 20. Juli 2020 um 16:34 schrieben Sie:

> I'm not sure I understand exactly how this "feature" would work.

Make internal types used in CASTs owned by the restoring user, like
all other objects are owned automatically as well. Postgres obviously
is able to detect those problems already and reowning automatically
would prevent people from the need to research first and do things
manually afterwards. One could optionally introduce an additional
flag, but if things like "--role" and "--no-owner" are specified,
intention of the users seem pretty clear to me.

In the worst case this problem makes people even NOT use individual
DB-users and use superuser for everything.

Just search for the topic about backing up databases using a read-only
user: It's that difficult, that people suggest creating a special
superuser set into read-only mode, from which it can recover itself
and stuff like that. Simply because granting permissions on unknown
schemas and maintaining default permissions for objects nobody knows
if they ever will be needed isn't really straightforward.

Using one concrete owner for everything right from the start is the
best one can do and that includes being able to reown in case of
restoring backups. And Postgres supports most of that already, only
the CAST-thing has not been thought to an end I guess.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow






view thread (14+ messages)  latest in thread

Message-ID: <486383440.20200720171023@am-soft.de>
Permalink:  ../486383440.20200720171023@am-soft.de/
Also on:    postgresql.org/message-id/486383440.20200720171023@am-soft.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tschoening@am-soft.de
  Subject: Re: How to restore a dump containing CASTs into a database with a new user?
  In-Reply-To: <486383440.20200720171023@am-soft.de>
  References: <1566481610.20200719202547@am-soft.de> <206414.1595183867@sss.pgh.pa.us> <1834098334.20200719215112@am-soft.de> <229216.1595191074@sss.pgh.pa.us> <929298897.20200719232557@am-soft.de> <B84FCC25-E4EE-4441-9788-9324FD9E0D2B@thebuild.com> <1097194106.20200720071316@am-soft.de> <D9A7BBE5-3AE4-4AE6-A267-853704EF84E9@thebuild.com> <315697639.20200720112813@am-soft.de> <FD2BE542-D6BD-49A2-B5B0-F6DCDB5CB960@thebuild.com> <486383440.20200720171023@am-soft.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox