私はユーザーを持っています:postgresqlのデータベースを所有し、(CREATE_DB、SUPERUSER、...)のようなROLE属性を持たないuser_x
このuser_xは、DB全体にアクセスし、(データベース上に)テーブルを作成し、データを選択、挿入、および更新できます。
私はこのデータベースのリストを持っています:
mydatabase=> \l
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
-------------------------+----------+-----------+-----------+-------+-----------------------
postgres | postgres | SQL_ASCII | C | C |
mydatabase | user_x | UTF8 | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
whoami | postgres | SQL_ASCII | C | C |
(6 rows)
および次の役割:
mydatabase=> \du
List of roles
Role name | Attributes | Member of
-----------+-----------------------------------+-----------
postgres | Superuser, Create role, Create DB | {}
user_x | | {}
mydatabase=> \d
List of relations
Schema | Name | Type | Owner
--------+-----------------------------------+----------+----------
public | addresses | table | user_x
public | addresses_id_seq | sequence | user_x
public | assignments | table | user_x
public | assignments_id_seq | sequence | user_x
...
データをダンプして別のpostgresqlサーバーに復元するまでは大丈夫です。
別のサーバー(同じデータベース名とユーザー)でデータをインポートし、psqlにログオンした後、\dコマンドは「関係が見つかりません」と応答します。
そこで、インポートしたデータベースサーバーのuser_xにSUPERUSERロールを追加すると、tadãuser_xはリレーションとデータを再度確認できます。
ただし、user_xは、このデータベースにアクセスするためにSUPERUSER権限を持っている必要はありません。
このインポートされたダンプの何が問題になっていますか?誰かが今これを解決する方法はありますか?