[pgsql-jp: 33583] リストア時のテーブルOwnerの反映

H_Matsuura matuura @ x.age.ne.jp
2004年 7月 9日 (金) 17:02:24 JST


はじめまして、松浦と申します

PostgreSQL 7.4.3 にてダンプ/リストアを
行おうとしているのですが、正常にリストアできません。

何度か試してみた結果、以下の様にすると再現するようです
何かお気づきの点がございましたら、
ご指摘の程よろしくお願いします。



%su postgres
%createdb DB1
%psql DB1

DB1=# create table A(foo text);

DB1=# create table B(foo text);
DB1=# grant all on B to user1;
DB1=# ALTER TABLE B OWNER TO user1;

DB1=# create table C(foo text);
DB1=# grant all on C to user1;
DB1=# ALTER TABLE C OWNER TO user1;

DB1=# \q

%psql -Uuser1 DB1

DB1=> create table D(foo text);
DB1=> insert into D values('value1');

DB1=> \d
        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 public | a    | table | postgres
 public | b    | table | user1
 public | c    | table | user1
 public | d    | table | user1
(4 rows)
DB1=# \q

%pg_dump DB1 > bk.log
%createdb DB2
%cat bk.log | psql DB2

ERROR:  permission denied for relation d
invalid command \.
ERROR:  syntax error at or near "value1" at character 1
ERROR:  must be owner of schema public

%psql DB2

DB2=# \d
        List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+----------
 public | a    | table | postgres
 public | b    | table | user1
 public | c    | table | postgres
 public | d    | table | postgres


テーブルC、DのOwnerが元のDB1 と変わってしまっており
データ挿入時にpermission のエラーが出てしまいます








pgsql-jp メーリングリストの案内